@pitcher/canvas-ui 2025.12.16-082908-beta → 2025.12.16-085511-beta

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.
@@ -238,6 +238,8 @@ export declare function createHighLevelApi(options?: ApiOptions): {
238
238
  crmSmartUpsertObjects(payload: import('../payload.types').UpsertCRMObjectsPayload): Promise<any>;
239
239
  crmSmartObjectValidationRules(payload: import('../payload.types').CRMSmartObjectValidationRulesPayload): Promise<any>;
240
240
  crmSmartDeleteObjects(payload: import('../payload.types').CRMSmartDeleteObjectsPayload): Promise<any>;
241
+ crmCreate(payload: import('../payload.types').CRMCreatePayload): Promise<any>;
242
+ crmUpsert(payload: import('../payload.types').CRMUpsertPayload): Promise<any>;
241
243
  getFolders(payload: import('../payload.types').FolderListRequest): Promise<import('../../main.lib').PaginatedFolderList>;
242
244
  getFolder(payload?: {
243
245
  id: import('../../main.lib').FolderRetrieve["id"];
@@ -1,4 +1,4 @@
1
- import { QueryPayload, CRMQueryPayload, UpsertCRMObjectsPayload, CRMSmartObjectValidationRulesPayload, CRMSmartObjectMetadataPayload, CRMSmartDeleteObjectsPayload } from '../../payload.types';
1
+ import { QueryPayload, CRMQueryPayload, UpsertCRMObjectsPayload, CRMSmartObjectValidationRulesPayload, CRMSmartObjectMetadataPayload, CRMSmartDeleteObjectsPayload, CRMCreatePayload, CRMUpsertPayload } from '../../payload.types';
2
2
  export declare function query(payload: QueryPayload): Promise<any>;
3
3
  export declare function crmQuery(payload: CRMQueryPayload): Promise<any>;
4
4
  /**
@@ -113,3 +113,43 @@ export declare function crmSmartObjectValidationRules(payload: CRMSmartObjectVal
113
113
  * })
114
114
  */
115
115
  export declare function crmSmartDeleteObjects(payload: CRMSmartDeleteObjectsPayload): Promise<any>;
116
+ /**
117
+ * Creates new records in CRM (Web only).
118
+ * Uses Salesforce REST API to create records.
119
+ *
120
+ * @param {CRMCreatePayload} payload - The create payload containing sobject type and records.
121
+ * @returns {Promise<any>} - Promise resolving with the result of the create operation.
122
+ * @throws {Error} - Throws an error if the payload is invalid.
123
+ *
124
+ * @example
125
+ * // Web only method to create CRM records.
126
+ * api.crmCreate({
127
+ * sobject: 'Order__c',
128
+ * records: [
129
+ * { Account__c: '001xx000003DGbQAAW', Order_Date__c: '2024-01-15' },
130
+ * { Account__c: '001xx000003DGbRABW', Order_Date__c: '2024-01-16' }
131
+ * ]
132
+ * })
133
+ */
134
+ export declare function crmCreate(payload: CRMCreatePayload): Promise<any>;
135
+ /**
136
+ * Upserts records in CRM (Web only).
137
+ * Uses Salesforce REST API to insert or update records based on external ID.
138
+ * If a record with matching external ID exists, it will be updated; otherwise, a new record is created.
139
+ *
140
+ * @param {CRMUpsertPayload} payload - The upsert payload containing sobject type, records, and external ID field.
141
+ * @returns {Promise<any>} - Promise resolving with the result of the upsert operation.
142
+ * @throws {Error} - Throws an error if the payload is invalid.
143
+ *
144
+ * @example
145
+ * // Web only method to upsert CRM records.
146
+ * api.crmUpsert({
147
+ * sobject: 'Order__c',
148
+ * records: [
149
+ * { External_Id__c: 'ORD-001', Account__c: '001xx000003DGbQAAW', Status__c: 'Submitted' },
150
+ * { External_Id__c: 'ORD-002', Account__c: '001xx000003DGbRABW', Status__c: 'Draft' }
151
+ * ],
152
+ * external_id_field: 'External_Id__c'
153
+ * })
154
+ */
155
+ export declare function crmUpsert(payload: CRMUpsertPayload): Promise<any>;
package/lib/sdk/main.d.ts CHANGED
@@ -309,6 +309,8 @@ export declare function useApi(options?: ApiOptions): {
309
309
  crmSmartUpsertObjects(payload: import('./payload.types').UpsertCRMObjectsPayload): Promise<any>;
310
310
  crmSmartObjectValidationRules(payload: import('./payload.types').CRMSmartObjectValidationRulesPayload): Promise<any>;
311
311
  crmSmartDeleteObjects(payload: import('./payload.types').CRMSmartDeleteObjectsPayload): Promise<any>;
312
+ crmCreate(payload: import('./payload.types').CRMCreatePayload): Promise<any>;
313
+ crmUpsert(payload: import('./payload.types').CRMUpsertPayload): Promise<any>;
312
314
  getFolders(payload: import('./payload.types').FolderListRequest): Promise<import('../main.lib').PaginatedFolderList>;
313
315
  getFolder(payload?: {
314
316
  id: import('../main.lib').FolderRetrieve["id"];
@@ -592,6 +594,8 @@ export declare function useApi(options?: ApiOptions): {
592
594
  crmSmartUpsertObjects(payload: import('./payload.types').UpsertCRMObjectsPayload): Promise<any>;
593
595
  crmSmartObjectValidationRules(payload: import('./payload.types').CRMSmartObjectValidationRulesPayload): Promise<any>;
594
596
  crmSmartDeleteObjects(payload: import('./payload.types').CRMSmartDeleteObjectsPayload): Promise<any>;
597
+ crmCreate(payload: import('./payload.types').CRMCreatePayload): Promise<any>;
598
+ crmUpsert(payload: import('./payload.types').CRMUpsertPayload): Promise<any>;
595
599
  getFolders(payload: import('./payload.types').FolderListRequest): Promise<import('../main.lib').PaginatedFolderList>;
596
600
  getFolder(payload?: {
597
601
  id: import('../main.lib').FolderRetrieve["id"];
@@ -811,6 +815,8 @@ export declare function useApi(options?: ApiOptions): {
811
815
  crmSmartUpsertObjects(payload: import('./payload.types').UpsertCRMObjectsPayload): Promise<any>;
812
816
  crmSmartObjectValidationRules(payload: import('./payload.types').CRMSmartObjectValidationRulesPayload): Promise<any>;
813
817
  crmSmartDeleteObjects(payload: import('./payload.types').CRMSmartDeleteObjectsPayload): Promise<any>;
818
+ crmCreate(payload: import('./payload.types').CRMCreatePayload): Promise<any>;
819
+ crmUpsert(payload: import('./payload.types').CRMUpsertPayload): Promise<any>;
814
820
  getFolders(payload: import('./payload.types').FolderListRequest): Promise<import('../main.lib').PaginatedFolderList>;
815
821
  getFolder(payload?: {
816
822
  id: import('../main.lib').FolderRetrieve["id"];
@@ -361,3 +361,46 @@ export interface CRMSmartDeleteObjectsPayload {
361
361
  */
362
362
  objects: CRMDeleteObject[];
363
363
  }
364
+ /**
365
+ * Payload for creating CRM records (Web only).
366
+ * Uses Salesforce REST API to create records.
367
+ */
368
+ export interface CRMCreatePayload {
369
+ /**
370
+ * The Salesforce object type (e.g., 'Account', 'Contact', 'Order__c').
371
+ */
372
+ sobject: string;
373
+ /**
374
+ * Array of records to create. Each record is a key-value map of field names to values.
375
+ * Field names should use Salesforce API names (e.g., 'Account__c', 'Order_Date__c').
376
+ */
377
+ records: Array<Record<string, unknown>>;
378
+ /**
379
+ * Optional name of the CRM service to use.
380
+ */
381
+ service?: CRMServiceType;
382
+ }
383
+ /**
384
+ * Payload for upserting CRM records (Web only).
385
+ * Uses Salesforce REST API to insert or update records based on external ID.
386
+ */
387
+ export interface CRMUpsertPayload {
388
+ /**
389
+ * The Salesforce object type (e.g., 'Account', 'Contact', 'Order__c').
390
+ */
391
+ sobject: string;
392
+ /**
393
+ * Array of records to upsert. Each record is a key-value map of field names to values.
394
+ * Field names should use Salesforce API names (e.g., 'Account__c', 'Order_Date__c').
395
+ */
396
+ records: Array<Record<string, unknown>>;
397
+ /**
398
+ * The external ID field used to match existing records for update.
399
+ * If a record with matching external ID exists, it will be updated; otherwise, a new record is created.
400
+ */
401
+ external_id_field: string;
402
+ /**
403
+ * Optional name of the CRM service to use.
404
+ */
405
+ service?: CRMServiceType;
406
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pitcher/canvas-ui",
3
- "version": "2025.12.16-082908-beta",
3
+ "version": "2025.12.16-085511-beta",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"