@pitcher/canvas-ui 2025.12.19-83033 → 2025.12.22-211404-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.
- package/canvas-ui.js +626 -7
- package/canvas-ui.js.map +1 -1
- package/lib/api/events/events.helpers.d.ts +3 -1
- package/lib/apps/canvas-builder/composables/useCanvas.d.ts +5 -0
- package/lib/composables/useSmartStore.d.ts +25 -0
- package/lib/main.lib.d.ts +2 -0
- package/lib/sdk/api/HighLevelApi.d.ts +2 -0
- package/lib/sdk/api/modules/query.d.ts +37 -1
- package/lib/sdk/main.d.ts +6 -0
- package/lib/sdk/payload.types.d.ts +14 -0
- package/lib/types/instanceSettings.types.d.ts +1 -0
- package/lib/types/sfdc.d.ts +3 -0
- package/lib/util/smart-store.util.d.ts +40 -0
- package/lib/util/smart-store.util.spec.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Event, MiniCanvas } from '../../../types/openapi';
|
|
2
2
|
import { SfAccountMini, SfEvent, SfUser } from '../../types/sfdc';
|
|
3
3
|
import { ComputedRef } from 'vue';
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function extractFieldNamesFromCondition(condition: string): string[];
|
|
5
|
+
export declare function evaluateIsExecutedCondition(condition: string | undefined, event: any): boolean;
|
|
6
|
+
export declare function getEventColor(_pEvent: Event, sfEvent: SfEvent): string;
|
|
5
7
|
export declare const minFutureDate: (date?: Date) => Date;
|
|
6
8
|
export declare const minPastDate: (date?: Date) => Date;
|
|
7
9
|
export declare const setDateTime: (date: number | Date) => number;
|
|
@@ -4865,6 +4865,7 @@ export default function useCanvas(): {
|
|
|
4865
4865
|
enable_recents?: boolean | undefined;
|
|
4866
4866
|
enable_favorites?: boolean | undefined;
|
|
4867
4867
|
enable_sync_file_filtering?: boolean | undefined;
|
|
4868
|
+
enable_sfdc_sync?: boolean | undefined;
|
|
4868
4869
|
time_format?: string | undefined;
|
|
4869
4870
|
date_format?: string | undefined;
|
|
4870
4871
|
is_file_expiration_mandatory?: boolean | undefined;
|
|
@@ -4907,6 +4908,7 @@ export default function useCanvas(): {
|
|
|
4907
4908
|
enable_multipeer_connectivity?: boolean;
|
|
4908
4909
|
enable_syncbox?: boolean;
|
|
4909
4910
|
enable_sync_file_filtering?: boolean;
|
|
4911
|
+
enable_sfdc_sync?: boolean;
|
|
4910
4912
|
time_format?: string;
|
|
4911
4913
|
date_format?: string;
|
|
4912
4914
|
is_file_expiration_mandatory?: boolean;
|
|
@@ -5195,6 +5197,7 @@ export default function useCanvas(): {
|
|
|
5195
5197
|
enable_recents?: boolean | undefined;
|
|
5196
5198
|
enable_favorites?: boolean | undefined;
|
|
5197
5199
|
enable_sync_file_filtering?: boolean | undefined;
|
|
5200
|
+
enable_sfdc_sync?: boolean | undefined;
|
|
5198
5201
|
time_format?: string | undefined;
|
|
5199
5202
|
date_format?: string | undefined;
|
|
5200
5203
|
is_file_expiration_mandatory?: boolean | undefined;
|
|
@@ -5517,6 +5520,7 @@ export default function useCanvas(): {
|
|
|
5517
5520
|
readonly enable_recents?: boolean | undefined;
|
|
5518
5521
|
readonly enable_favorites?: boolean | undefined;
|
|
5519
5522
|
readonly enable_sync_file_filtering?: boolean | undefined;
|
|
5523
|
+
readonly enable_sfdc_sync?: boolean | undefined;
|
|
5520
5524
|
readonly time_format?: string | undefined;
|
|
5521
5525
|
readonly date_format?: string | undefined;
|
|
5522
5526
|
readonly is_file_expiration_mandatory?: boolean | undefined;
|
|
@@ -5838,6 +5842,7 @@ export default function useCanvas(): {
|
|
|
5838
5842
|
readonly enable_recents?: boolean | undefined;
|
|
5839
5843
|
readonly enable_favorites?: boolean | undefined;
|
|
5840
5844
|
readonly enable_sync_file_filtering?: boolean | undefined;
|
|
5845
|
+
readonly enable_sfdc_sync?: boolean | undefined;
|
|
5841
5846
|
readonly time_format?: string | undefined;
|
|
5842
5847
|
readonly date_format?: string | undefined;
|
|
5843
5848
|
readonly is_file_expiration_mandatory?: boolean | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { PitcherEnv } from '../sdk/interfaces';
|
|
3
|
+
/**
|
|
4
|
+
* Composable for SmartStore availability checks
|
|
5
|
+
*
|
|
6
|
+
* SmartStore is Salesforce Mobile SDK's local database for offline data access on iOS.
|
|
7
|
+
* It requires both iOS mode and the enable_sfdc_sync instance setting to be enabled.
|
|
8
|
+
*
|
|
9
|
+
* @param env - Optional reactive environment object from app store (avoids redundant API calls)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // With app store env (recommended - avoids API calls)
|
|
13
|
+
* const appStore = useAppStore()
|
|
14
|
+
* const { shouldUseSmartStore } = useSmartStore(appStore.env)
|
|
15
|
+
* const enabled = shouldUseSmartStore.value
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // Without env (for canvas-ui internal usage)
|
|
19
|
+
* const { generateTempSalesforceId } = useSmartStore()
|
|
20
|
+
* const tempId = generateTempSalesforceId('00U')
|
|
21
|
+
*/
|
|
22
|
+
export declare function useSmartStore(env?: Ref<PitcherEnv | null> | PitcherEnv | null): {
|
|
23
|
+
shouldUseSmartStore: import('vue').ComputedRef<boolean>;
|
|
24
|
+
generateTempSalesforceId: (objectPrefix: string) => string;
|
|
25
|
+
};
|
package/lib/main.lib.d.ts
CHANGED
|
@@ -137,6 +137,7 @@ export * as agendaSelector from './apps/agenda-selector/export';
|
|
|
137
137
|
export { default as useTheme } from './composables/useTheme';
|
|
138
138
|
export { default as useThemeVars } from './composables/useThemeVars';
|
|
139
139
|
export { default as useBindValidation } from './composables/useBindValidation';
|
|
140
|
+
export { useSmartStore } from './composables/useSmartStore';
|
|
140
141
|
export { default as useFileDisplayHelpers } from './composables/useFileDisplayHelpers';
|
|
141
142
|
export { default as useFolderNameDescription } from './composables/useFolderNameDescription';
|
|
142
143
|
export { default as useCanvasOverlay } from './composables/useCanvasOverlay';
|
|
@@ -196,6 +197,7 @@ export * from './util/storage.util';
|
|
|
196
197
|
export * from './util/handlebars';
|
|
197
198
|
export * from './apps/collection-selector/utils/content-selector-adapter.util';
|
|
198
199
|
export * from './util/soql.util.ts';
|
|
200
|
+
export * from './util/smart-store.util';
|
|
199
201
|
export * from './util/app.util';
|
|
200
202
|
export * from './utils/iframeInitialize';
|
|
201
203
|
export * from './sdk/main';
|
|
@@ -233,6 +233,7 @@ export declare function createHighLevelApi(options?: ApiOptions): {
|
|
|
233
233
|
}): Promise<void>;
|
|
234
234
|
query(payload: import('../payload.types').QueryPayload): Promise<any>;
|
|
235
235
|
crmQuery(payload: import('../payload.types').CRMQueryPayload): Promise<any>;
|
|
236
|
+
crmQueryAdaptive(payload: import('../payload.types').CRMQueryPayload): Promise<any>;
|
|
236
237
|
crmSmartQuery(payload: import('../payload.types').CRMQueryPayload): Promise<Array<any>>;
|
|
237
238
|
crmSmartObjectMetadata(payload: import('../payload.types').CRMSmartObjectMetadataPayload): Promise<any>;
|
|
238
239
|
crmSmartUpsertObjects(payload: import('../payload.types').UpsertCRMObjectsPayload): Promise<any>;
|
|
@@ -240,6 +241,7 @@ export declare function createHighLevelApi(options?: ApiOptions): {
|
|
|
240
241
|
crmSmartDeleteObjects(payload: import('../payload.types').CRMSmartDeleteObjectsPayload): Promise<any>;
|
|
241
242
|
crmCreate(payload: import('../payload.types').CRMCreatePayload): Promise<any>;
|
|
242
243
|
crmUpsert(payload: import('../payload.types').CRMUpsertPayload): Promise<any>;
|
|
244
|
+
crmDescribe(payload: import('../payload.types').CRMDescribePayload): Promise<any>;
|
|
243
245
|
getFolders(payload: import('../payload.types').FolderListRequest): Promise<import('../../main.lib').PaginatedFolderList>;
|
|
244
246
|
getFolder(payload?: {
|
|
245
247
|
id: import('../../main.lib').FolderRetrieve["id"];
|
|
@@ -1,6 +1,22 @@
|
|
|
1
|
-
import { QueryPayload, CRMQueryPayload, UpsertCRMObjectsPayload, CRMSmartObjectValidationRulesPayload, CRMSmartObjectMetadataPayload, CRMSmartDeleteObjectsPayload, CRMCreatePayload, CRMUpsertPayload } from '../../payload.types';
|
|
1
|
+
import { QueryPayload, CRMQueryPayload, UpsertCRMObjectsPayload, CRMSmartObjectValidationRulesPayload, CRMSmartObjectMetadataPayload, CRMSmartDeleteObjectsPayload, CRMCreatePayload, CRMUpsertPayload, CRMDescribePayload } from '../../payload.types';
|
|
2
2
|
export declare function query(payload: QueryPayload): Promise<any>;
|
|
3
3
|
export declare function crmQuery(payload: CRMQueryPayload): Promise<any>;
|
|
4
|
+
/**
|
|
5
|
+
* Executes a CRM query with automatic iOS/SmartStore adaptation.
|
|
6
|
+
*
|
|
7
|
+
* On iOS devices with the 'enable_sfdc_sync' instance setting enabled,
|
|
8
|
+
* this function automatically converts SOQL queries to SmartStore Smart SQL format
|
|
9
|
+
* and uses the local SmartStore for offline data access.
|
|
10
|
+
* On other platforms or when the setting is disabled, it uses the standard CRM query API.
|
|
11
|
+
*
|
|
12
|
+
* @param {CRMQueryPayload} payload - The query payload containing the SOQL query string.
|
|
13
|
+
* @returns {Promise<any>} - Promise resolving with query results.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Works on all platforms - automatically adapts for iOS with enable_sfdc_sync instance setting
|
|
17
|
+
* const result = await crmQueryAdaptive({ query: 'SELECT Id, Name FROM Account WHERE Active = true' })
|
|
18
|
+
*/
|
|
19
|
+
export declare function crmQueryAdaptive(payload: CRMQueryPayload): Promise<any>;
|
|
4
20
|
/**
|
|
5
21
|
* Executes a SmartStore query against local CRM data (iOS only).
|
|
6
22
|
* Uses Salesforce Mobile SDK SmartStore query syntax.
|
|
@@ -153,3 +169,23 @@ export declare function crmCreate(payload: CRMCreatePayload): Promise<any>;
|
|
|
153
169
|
* })
|
|
154
170
|
*/
|
|
155
171
|
export declare function crmUpsert(payload: CRMUpsertPayload): Promise<any>;
|
|
172
|
+
/**
|
|
173
|
+
* Retrieves metadata/describe for a CRM object (Web only).
|
|
174
|
+
* Uses Salesforce REST API to fetch object metadata including fields and picklist values.
|
|
175
|
+
*
|
|
176
|
+
* @param {CRMDescribePayload} payload - The describe payload containing the sobject name.
|
|
177
|
+
* @returns {Promise<any>} - Promise resolving with the object metadata including fields and picklist values.
|
|
178
|
+
* @throws {Error} - Throws an error if the payload is invalid.
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* // Web only method to get CRM object metadata.
|
|
182
|
+
* api.crmDescribe({ sobject: 'Account' })
|
|
183
|
+
* .then(metadata => {
|
|
184
|
+
* // Access fields
|
|
185
|
+
* console.log(metadata.fields)
|
|
186
|
+
* // Access picklist values for a specific field
|
|
187
|
+
* const industryField = metadata.fields.find(f => f.name === 'Industry')
|
|
188
|
+
* console.log(industryField.picklistValues)
|
|
189
|
+
* })
|
|
190
|
+
*/
|
|
191
|
+
export declare function crmDescribe(payload: CRMDescribePayload): Promise<any>;
|
package/lib/sdk/main.d.ts
CHANGED
|
@@ -304,6 +304,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
304
304
|
}): Promise<void>;
|
|
305
305
|
query(payload: import('./payload.types').QueryPayload): Promise<any>;
|
|
306
306
|
crmQuery(payload: import('./payload.types').CRMQueryPayload): Promise<any>;
|
|
307
|
+
crmQueryAdaptive(payload: import('./payload.types').CRMQueryPayload): Promise<any>;
|
|
307
308
|
crmSmartQuery(payload: import('./payload.types').CRMQueryPayload): Promise<Array<any>>;
|
|
308
309
|
crmSmartObjectMetadata(payload: import('./payload.types').CRMSmartObjectMetadataPayload): Promise<any>;
|
|
309
310
|
crmSmartUpsertObjects(payload: import('./payload.types').UpsertCRMObjectsPayload): Promise<any>;
|
|
@@ -311,6 +312,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
311
312
|
crmSmartDeleteObjects(payload: import('./payload.types').CRMSmartDeleteObjectsPayload): Promise<any>;
|
|
312
313
|
crmCreate(payload: import('./payload.types').CRMCreatePayload): Promise<any>;
|
|
313
314
|
crmUpsert(payload: import('./payload.types').CRMUpsertPayload): Promise<any>;
|
|
315
|
+
crmDescribe(payload: import('./payload.types').CRMDescribePayload): Promise<any>;
|
|
314
316
|
getFolders(payload: import('./payload.types').FolderListRequest): Promise<import('../main.lib').PaginatedFolderList>;
|
|
315
317
|
getFolder(payload?: {
|
|
316
318
|
id: import('../main.lib').FolderRetrieve["id"];
|
|
@@ -589,6 +591,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
589
591
|
}): Promise<void>;
|
|
590
592
|
query(payload: import('./payload.types').QueryPayload): Promise<any>;
|
|
591
593
|
crmQuery(payload: import('./payload.types').CRMQueryPayload): Promise<any>;
|
|
594
|
+
crmQueryAdaptive(payload: import('./payload.types').CRMQueryPayload): Promise<any>;
|
|
592
595
|
crmSmartQuery(payload: import('./payload.types').CRMQueryPayload): Promise<Array<any>>;
|
|
593
596
|
crmSmartObjectMetadata(payload: import('./payload.types').CRMSmartObjectMetadataPayload): Promise<any>;
|
|
594
597
|
crmSmartUpsertObjects(payload: import('./payload.types').UpsertCRMObjectsPayload): Promise<any>;
|
|
@@ -596,6 +599,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
596
599
|
crmSmartDeleteObjects(payload: import('./payload.types').CRMSmartDeleteObjectsPayload): Promise<any>;
|
|
597
600
|
crmCreate(payload: import('./payload.types').CRMCreatePayload): Promise<any>;
|
|
598
601
|
crmUpsert(payload: import('./payload.types').CRMUpsertPayload): Promise<any>;
|
|
602
|
+
crmDescribe(payload: import('./payload.types').CRMDescribePayload): Promise<any>;
|
|
599
603
|
getFolders(payload: import('./payload.types').FolderListRequest): Promise<import('../main.lib').PaginatedFolderList>;
|
|
600
604
|
getFolder(payload?: {
|
|
601
605
|
id: import('../main.lib').FolderRetrieve["id"];
|
|
@@ -810,6 +814,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
810
814
|
}): Promise<ArrayBuffer>;
|
|
811
815
|
query(payload: import('./payload.types').QueryPayload): Promise<any>;
|
|
812
816
|
crmQuery(payload: import('./payload.types').CRMQueryPayload): Promise<any>;
|
|
817
|
+
crmQueryAdaptive(payload: import('./payload.types').CRMQueryPayload): Promise<any>;
|
|
813
818
|
crmSmartQuery(payload: import('./payload.types').CRMQueryPayload): Promise<Array<any>>;
|
|
814
819
|
crmSmartObjectMetadata(payload: import('./payload.types').CRMSmartObjectMetadataPayload): Promise<any>;
|
|
815
820
|
crmSmartUpsertObjects(payload: import('./payload.types').UpsertCRMObjectsPayload): Promise<any>;
|
|
@@ -817,6 +822,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
817
822
|
crmSmartDeleteObjects(payload: import('./payload.types').CRMSmartDeleteObjectsPayload): Promise<any>;
|
|
818
823
|
crmCreate(payload: import('./payload.types').CRMCreatePayload): Promise<any>;
|
|
819
824
|
crmUpsert(payload: import('./payload.types').CRMUpsertPayload): Promise<any>;
|
|
825
|
+
crmDescribe(payload: import('./payload.types').CRMDescribePayload): Promise<any>;
|
|
820
826
|
getFolders(payload: import('./payload.types').FolderListRequest): Promise<import('../main.lib').PaginatedFolderList>;
|
|
821
827
|
getFolder(payload?: {
|
|
822
828
|
id: import('../main.lib').FolderRetrieve["id"];
|
|
@@ -404,3 +404,17 @@ export interface CRMUpsertPayload {
|
|
|
404
404
|
*/
|
|
405
405
|
service?: CRMServiceType;
|
|
406
406
|
}
|
|
407
|
+
/**
|
|
408
|
+
* Payload for retrieving CRM object metadata/describe (Web only).
|
|
409
|
+
* Uses Salesforce REST API to fetch object metadata including fields and picklist values.
|
|
410
|
+
*/
|
|
411
|
+
export interface CRMDescribePayload {
|
|
412
|
+
/**
|
|
413
|
+
* The Salesforce object type to describe (e.g., 'Account', 'Contact', 'Opportunity').
|
|
414
|
+
*/
|
|
415
|
+
sobject: string;
|
|
416
|
+
/**
|
|
417
|
+
* Optional name of the CRM service to use.
|
|
418
|
+
*/
|
|
419
|
+
service?: CRMServiceType;
|
|
420
|
+
}
|
|
@@ -60,6 +60,7 @@ export type InstanceSettings = OrganizationSettings & {
|
|
|
60
60
|
enable_multipeer_connectivity?: boolean;
|
|
61
61
|
enable_syncbox?: boolean;
|
|
62
62
|
enable_sync_file_filtering?: boolean;
|
|
63
|
+
enable_sfdc_sync?: boolean;
|
|
63
64
|
time_format?: string;
|
|
64
65
|
date_format?: string;
|
|
65
66
|
is_file_expiration_mandatory?: boolean;
|
package/lib/types/sfdc.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export type SfEvent = {
|
|
|
59
59
|
Type?: string;
|
|
60
60
|
EventWhoIds?: string[];
|
|
61
61
|
IsAllDayEvent?: boolean;
|
|
62
|
+
is_executed_condition?: string;
|
|
62
63
|
};
|
|
63
64
|
export type SfEventExtended = SfEvent & {
|
|
64
65
|
contactName?: string;
|
|
@@ -108,6 +109,8 @@ export interface SfContactBasic {
|
|
|
108
109
|
};
|
|
109
110
|
callId?: string;
|
|
110
111
|
PersonAccountId?: string;
|
|
112
|
+
AccountName?: string;
|
|
113
|
+
Account?: any;
|
|
111
114
|
}
|
|
112
115
|
export type EventsSfList = {
|
|
113
116
|
done?: boolean;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SmartStore Smart SQL Query Utilities
|
|
3
|
+
*
|
|
4
|
+
* This module provides utilities for converting SOQL queries to SmartStore Smart SQL format
|
|
5
|
+
* for offline data access on iOS devices using Salesforce Mobile SDK.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Comprehensive SOQL to SmartStore Smart Query converter
|
|
9
|
+
*
|
|
10
|
+
* Converts standard SOQL queries to SmartStore Smart SQL format for offline use on iOS.
|
|
11
|
+
* Handles SELECT, FROM, WHERE, ORDER BY, GROUP BY, HAVING, LIMIT, OFFSET,
|
|
12
|
+
* aggregate functions, and relationship fields.
|
|
13
|
+
*
|
|
14
|
+
* SmartStore stores denormalized data, so relationship fields are accessed directly
|
|
15
|
+
* within the soup using the full relationship path (e.g., Child_Account_vod__r.Name).
|
|
16
|
+
*
|
|
17
|
+
* @param soqlQuery - The SOQL query string to convert
|
|
18
|
+
* @returns The converted SmartStore Smart SQL query string
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Simple query
|
|
22
|
+
* convertSoqlToSmartQuery('SELECT Id, Name FROM Account WHERE Active = true')
|
|
23
|
+
* // Returns: SELECT {Account:Id}, {Account:Name} FROM {Account} WHERE {Account:Active} = true
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // With relationship fields (denormalized access - no joins needed)
|
|
27
|
+
* convertSoqlToSmartQuery('SELECT Id, Child_Account_vod__r.Name FROM Child_Account_vod__c')
|
|
28
|
+
* // Returns: SELECT {Child_Account_vod__c:Id}, {Child_Account_vod__c:Child_Account_vod__r.Name} FROM {Child_Account_vod__c}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // With aggregate functions
|
|
32
|
+
* convertSoqlToSmartQuery('SELECT COUNT(Id), Industry FROM Account GROUP BY Industry')
|
|
33
|
+
* // Returns: SELECT COUNT({Account:Id}), {Account:Industry} FROM {Account} GROUP BY {Account:Industry}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // With ORDER BY and LIMIT
|
|
37
|
+
* convertSoqlToSmartQuery('SELECT Id, Name FROM Contact ORDER BY LastName ASC, FirstName DESC LIMIT 100')
|
|
38
|
+
* // Returns: SELECT {Contact:Id}, {Contact:Name} FROM {Contact} ORDER BY {Contact:LastName} ASC, {Contact:FirstName} DESC LIMIT 100
|
|
39
|
+
*/
|
|
40
|
+
export declare function convertSoqlToSmartQuery(soqlQuery: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|