@agentforge-io/sdk-server 4.87.0 → 4.88.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.
package/dist/index.d.ts CHANGED
@@ -29,7 +29,7 @@ export type { ListMarketplaceCategoriesInput } from './resources/marketplace';
29
29
  export { TenantConfigResource } from './resources/config';
30
30
  export { PlacesResource } from './resources/places';
31
31
  export { ContactsResource, ContactVerificationResource, ContactAddressesResource, ContactTagsResource, ContactListsResource, } from './resources/contacts';
32
- export type { ContactVerificationChannel, LinkContactInput, LinkContactResult, AppContact, ContactAvatarUploadTarget, ClaimContactInput, ClaimContactResult, StartVerificationInput, StartVerificationResult, ConfirmVerificationInput, ConfirmVerificationResult, ContactDocumentType, ContactDocumentInput, ContactDocument, ContactMatchedBy, ContactSummary, ContactSegment, ContactSort, ContactStats, ContactNote, BusinessContact, ContactPage, SearchContactsInput, CreateBusinessContactInput, UpdateBusinessContactInput, ContactAddress, ContactAddressInput, ContactTag, ContactList, } from './resources/contacts';
32
+ export type { ContactVerificationChannel, LinkContactInput, LinkContactResult, AppContact, ContactAvatarUploadTarget, ClaimContactInput, ClaimContactResult, StartVerificationInput, StartVerificationResult, ConfirmVerificationInput, ConfirmVerificationResult, ContactDocumentType, ContactDocumentInput, ContactDocument, ContactMatchedBy, ContactSummary, ContactSegment, ContactSort, ContactStats, ContactNote, BusinessContact, ContactProperties, ContactPropertiesPatch, ContactPropertyValue, ContactPage, SearchContactsInput, CreateBusinessContactInput, UpdateBusinessContactInput, ContactAddress, ContactAddressInput, ContactTag, ContactList, } from './resources/contacts';
33
33
  export { FilesResource } from './resources/files';
34
34
  export type { AppFileKind, SignAppFileInput, AppFileUploadTarget } from './resources/files';
35
35
  export { DeliveryResource } from './resources/delivery';
@@ -203,7 +203,24 @@ export interface ContactNote {
203
203
  createdAt: string;
204
204
  updatedAt: string;
205
205
  }
206
+ /** PDK-CONTACT-FIELDS C1 — a custom property value. Strings ≤ 500 characters; numbers finite. */
207
+ export type ContactPropertyValue = string | number | boolean;
208
+ /** What `BusinessContact.properties` holds: this App's properties of the contact. */
209
+ export type ContactProperties = Record<string, ContactPropertyValue>;
210
+ /**
211
+ * PDK-CONTACT-FIELDS C1 — `properties` on create/update (and `customer.properties` of `cases.createDirect*`).
212
+ * MERGED into the App's stored properties: a value sets or overwrites the key, `null` deletes it, absent keys are kept.
213
+ * Limits (400 otherwise, `error` = `invalid_properties` | `invalid_property_key` | `invalid_property_value` |
214
+ * `too_many_properties`): keys match `/^[a-z][a-z0-9_]{0,39}$/`, string values ≤ 500 characters, at most 50 keys
215
+ * stored per App per contact.
216
+ */
217
+ export type ContactPropertiesPatch = Record<string, ContactPropertyValue | null>;
206
218
  export interface BusinessContact extends ContactSummary {
219
+ /**
220
+ * PDK-CONTACT-FIELDS C1 — the custom properties YOUR App stored on this contact (namespaced per App: another App's
221
+ * keys are never visible nor overwritten). `{}` when none. Absent on a platform older than C1.
222
+ */
223
+ properties?: ContactProperties;
207
224
  marketingConsent: boolean;
208
225
  marketingConsentAt: string | null;
209
226
  notes: string | null;
@@ -240,6 +257,8 @@ export interface CreateBusinessContactInput {
240
257
  tags?: string[];
241
258
  /** «Acepta recibir promociones» (Ley 1581). Default `false`. */
242
259
  marketingConsent?: boolean;
260
+ /** PDK-CONTACT-FIELDS C1 — custom properties of this App on the contact (see `ContactPropertiesPatch`). */
261
+ properties?: ContactPropertiesPatch;
243
262
  }
244
263
  export interface UpdateBusinessContactInput {
245
264
  /** The business contact to change (`ContactSummary.id`). */
@@ -254,6 +273,8 @@ export interface UpdateBusinessContactInput {
254
273
  addTags?: string[];
255
274
  removeTags?: string[];
256
275
  marketingConsent?: boolean;
276
+ /** PDK-CONTACT-FIELDS C1 — MERGED into this App's properties; a `null` value deletes that key. */
277
+ properties?: ContactPropertiesPatch;
257
278
  }
258
279
  export interface ContactAddress {
259
280
  id: string;
@@ -25,6 +25,8 @@
25
25
  // - `create(...)` — needs a name, a phone or a document; a phone/document that
26
26
  // already exists throws `AgentForgeDuplicateContactError` (`existingId`).
27
27
  // - `getById(id)` · `update({ contactId, ... })` (documents, tags, consent).
28
+ // - `properties` (PDK-CONTACT-FIELDS C1) on `create` / `update` / `getById`: custom fields of YOUR App on the contact,
29
+ // merged per key (`null` deletes), namespaced per App (≤ 50 keys, key `[a-z][a-z0-9_]{0,39}`, string ≤ 500).
28
30
  // - `addresses.*` · `tags.*` (per-business catalog) · `lists.*` (static lists).
29
31
  Object.defineProperty(exports, "__esModule", { value: true });
30
32
  exports.ContactsResource = exports.ContactListsResource = exports.ContactTagsResource = exports.ContactNotesResource = exports.ContactAddressesResource = exports.ContactVerificationResource = void 0;
package/dist/types.d.ts CHANGED
@@ -2998,12 +2998,16 @@ export interface CreateDirectOrderInput {
2998
2998
  * Who orders: the App's visitor id, and the name and phone they gave (both required
2999
2999
  * unless `place`). A sale the team registers (`origin.channel` `pos`) may leave both
3000
3000
  * out: it is then named after its place («Mostrador», «Mesa 2») and has no phone.
3001
+ * `customer.properties` (PDK-CONTACT-FIELDS C1, also on open orders, bookings and rentals): custom contact properties of
3002
+ * your App, merged (`null` deletes) onto the contact the case links to once it is created; no linked contact → not
3003
+ * written. 400 (`invalid_property_*`) before anything is held when malformed.
3001
3004
  */
3002
3005
  customer: {
3003
3006
  ref: string;
3004
3007
  name?: string;
3005
3008
  phone?: string;
3006
3009
  contactId?: string;
3010
+ properties?: ContactPropertiesPatch;
3007
3011
  };
3008
3012
  /** AGF-ORDER-ORIGIN-POS — where it comes from; default `{ channel: 'page' }`. A `pos` sale needs `place` and `by`. */
3009
3013
  origin?: CaseOrigin;
@@ -3108,6 +3112,7 @@ export interface CreateOpenOrderInput {
3108
3112
  name?: string;
3109
3113
  phone?: string;
3110
3114
  contactId?: string;
3115
+ properties?: ContactPropertiesPatch;
3111
3116
  };
3112
3117
  origin: {
3113
3118
  channel: 'link';
@@ -3417,6 +3422,7 @@ export interface CreateDirectBookingInput {
3417
3422
  name: string;
3418
3423
  phone: string;
3419
3424
  contactId?: string;
3425
+ properties?: ContactPropertiesPatch;
3420
3426
  };
3421
3427
  /** A catalog service of the business with a `booking` rule. */
3422
3428
  serviceId: string;
@@ -3529,6 +3535,7 @@ export interface MoveCaseSlotInput {
3529
3535
  assigneeName?: string;
3530
3536
  }
3531
3537
  import type { AppBillingWebhookEvent } from './resources/billing';
3538
+ import type { ContactPropertiesPatch } from './resources/contacts';
3532
3539
  export type AppCaseWebhookEventName = 'case.submitted' | 'case.state_changed' | 'case.closed' | 'case.customer_request' | 'case.payment_changed' | 'case.proposal';
3533
3540
  export type AppWebhookEventName = AppCaseWebhookEventName | 'conversation.message' | 'channel.status_changed' | 'billing.plan_changed' | 'billing.trial_ended';
3534
3541
  export interface AppWebhook {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.87.0",
3
+ "version": "4.88.0",
4
4
  "description": "Server-side SDK for backend apps integrating with AgentForge platform. Auth via ChatToken, ak_live_ API key or App secret (sk_live_), with App installations across tenants.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",