@pitcher/js-api 1.28.0 → 1.30.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.
Files changed (90) hide show
  1. package/js-api.esm.js +477 -44
  2. package/js-api.esm.js.map +1 -1
  3. package/js-api.umd.min.js +32 -11
  4. package/js-api.umd.min.js.map +1 -1
  5. package/lib/ai-tasks/__tests__/weekly-focus.spec.d.ts +1 -0
  6. package/lib/ai-tasks/weekly-focus.d.ts +241 -0
  7. package/lib/apps/browser/appTypes.d.ts +28 -0
  8. package/lib/apps/browser/stores/api.d.ts +6 -1
  9. package/lib/apps/browser/stores/app.d.ts +5 -0
  10. package/lib/apps/browser/stores/app.selectionPruneScope.test.d.ts +1 -0
  11. package/lib/apps/browser/stores/upload.d.ts +26 -1
  12. package/lib/apps/browser/stores/upload.types.d.ts +9 -0
  13. package/lib/apps/browser/util/lifecycle.d.ts +57 -0
  14. package/lib/apps/browser/util/lifecycle.test.d.ts +1 -0
  15. package/lib/apps/canvas-builder/components/ui/DynamicContent/useDynamicContent.d.ts +2 -0
  16. package/lib/apps/canvas-builder/components/ui/Multimedia/Multimedia.ldAsset.spec.d.ts +1 -0
  17. package/lib/apps/canvas-builder/composables/useCanvas.d.ts +203 -1
  18. package/lib/apps/canvas-builder/composables/useCanvas.saveEcho.spec.d.ts +1 -0
  19. package/lib/apps/canvas-builder/composables/useCanvasBlocks.d.ts +36 -0
  20. package/lib/apps/canvas-builder/composables/useCanvasExit.d.ts +1 -0
  21. package/lib/apps/canvas-builder/composables/useCanvasHistory.d.ts +36 -0
  22. package/lib/apps/canvas-builder/composables/useCanvasTheme.d.ts +20 -18
  23. package/lib/apps/canvas-builder/composables/useContentSelector.d.ts +8 -1
  24. package/lib/apps/canvas-builder/composables/useInstalledEmbeddables.d.ts +1 -1
  25. package/lib/apps/canvas-builder/composables/useNavigatorDrawer.d.ts +2 -0
  26. package/lib/apps/canvas-builder/composables/usePopupApps.d.ts +2 -0
  27. package/lib/apps/canvas-builder/types/canvas.d.ts +53 -3
  28. package/lib/apps/canvas-builder/util/canvas.util.d.ts +8 -0
  29. package/lib/apps/canvas-builder/util/completionWizard.util.d.ts +107 -0
  30. package/lib/apps/canvas-builder/util/completionWizard.util.test.d.ts +1 -0
  31. package/lib/apps/canvas-builder/util/fullscreenMode.util.d.ts +7 -0
  32. package/lib/apps/canvas-builder/util/fullscreenMode.util.test.d.ts +1 -0
  33. package/lib/apps/canvas-builder/util/lazySections.util.d.ts +35 -0
  34. package/lib/apps/canvas-builder/util/lazySections.util.test.d.ts +1 -0
  35. package/lib/apps/collection-player/composables/collection-navigation.util.d.ts +27 -0
  36. package/lib/apps/collection-player/composables/collection-navigation.util.spec.d.ts +1 -0
  37. package/lib/apps/collection-player/stores/app.store.d.ts +3 -0
  38. package/lib/apps/content-selector/components/Assets.uploaderRefresh.spec.d.ts +1 -0
  39. package/lib/apps/content-selector/stores/app.d.ts +1 -1
  40. package/lib/components/CFileViewer/pdf/CFileViewer.pdf.annotations.use.d.ts +5 -1
  41. package/lib/components/CFileViewer/pdf/CFileViewer.pdf.formFields.use.d.ts +8 -0
  42. package/lib/components/CFileViewer/pdf/CFileViewer.pdf.link.use.d.ts +1 -1
  43. package/lib/components/CFileViewer/pdf/CFileViewer.pdf.overlayItems.use.d.ts +1 -1
  44. package/lib/components/CFileViewer/pdf/CFileViewer.pdf.use.d.ts +4 -9
  45. package/lib/components/CFileViewer/pdf/CFileViewer.pdf.util.d.ts +1 -1
  46. package/lib/components/CFileViewer/pdf/CFileViewerFullscreen.pdf.use.d.ts +1 -1
  47. package/lib/components/CFileViewer/pdf/__tests__/CFileViewer.pdf.annotations.text.test.d.ts +1 -0
  48. package/lib/components/savedCanvases/CSavedCanvasesManagement.use.d.ts +1 -0
  49. package/lib/composables/useCourseOnlyApps.d.ts +1 -1
  50. package/lib/composables/usePdfInterpolation.d.ts +2 -2
  51. package/lib/composables/useWindowEvents.d.ts +1 -1
  52. package/lib/constants/cdp.const.d.ts +1 -0
  53. package/lib/constants/translationLanguages.const.d.ts +72 -0
  54. package/lib/main.lib.d.ts +2 -0
  55. package/lib/sdk/api/HighLevelApi.d.ts +26 -9
  56. package/lib/sdk/api/modules/admin/types.admin.d.ts +1 -0
  57. package/lib/sdk/api/modules/ai.d.ts +43 -1
  58. package/lib/sdk/api/modules/ai.spec.d.ts +1 -0
  59. package/lib/sdk/api/modules/canvas.d.ts +8 -0
  60. package/lib/sdk/api/modules/index.d.ts +2 -1
  61. package/lib/sdk/api/modules/stt.d.ts +65 -0
  62. package/lib/sdk/api/modules/stt.spec.d.ts +1 -0
  63. package/lib/sdk/api/modules/tts.d.ts +41 -0
  64. package/lib/sdk/api/modules/tts.spec.d.ts +1 -0
  65. package/lib/sdk/api/modules/ui/types.ui.d.ts +7 -0
  66. package/lib/sdk/interfaces.d.ts +26 -1
  67. package/lib/sdk/main.d.ts +35 -6
  68. package/lib/sdk/payload.types.d.ts +284 -0
  69. package/lib/types/ai-tasks.const.d.ts +39 -1
  70. package/lib/types/call.d.ts +14 -0
  71. package/lib/types/canvases.d.ts +0 -3
  72. package/lib/types/launchDarkly.types.d.ts +1 -3
  73. package/lib/types/organizationSettings.types.d.ts +10 -0
  74. package/lib/types/sfdc.d.ts +15 -0
  75. package/lib/util/soql.util.d.ts +36 -0
  76. package/lib/util/user.d.ts +18 -0
  77. package/lib/util/user.test.d.ts +1 -0
  78. package/package.json +1 -1
  79. package/types/openapi/index.d.ts +0 -1
  80. package/types/openapi/models/DeletedEnvironment.d.ts +0 -1
  81. package/types/openapi/models/Environment.d.ts +0 -1
  82. package/types/openapi/models/EnvironmentRequest.d.ts +0 -1
  83. package/types/openapi/models/File.d.ts +2 -0
  84. package/types/openapi/models/FileRetrieve.d.ts +2 -0
  85. package/types/openapi/models/PatchedEnvironmentRequest.d.ts +0 -1
  86. package/types/openapi/models/PatchedUserRequest.d.ts +1 -2
  87. package/types/openapi/models/User.d.ts +1 -2
  88. package/types/openapi/models/UserRequest.d.ts +1 -2
  89. package/lib/sdk/api/modules/languages.d.ts +0 -8
  90. package/types/openapi/models/LanguageEnum.d.ts +0 -12
@@ -1,4 +1,40 @@
1
+ /**
2
+ * Escape a user-typed search term for interpolation into a SOQL LIKE pattern or
3
+ * SOSL FIND term. Escapes the LIKE wildcards `%` and `_` in addition to quotes
4
+ * and control characters — do NOT use it for equality/IN comparison values,
5
+ * where escaping the wildcards would change the compared value; use
6
+ * `soqlLiteral` / `soqlIn` / `soqlEq` for those.
7
+ */
1
8
  export declare const escapeSoqlString: (input: string) => string;
9
+ /**
10
+ * Quote a value as a SOQL string literal for equality/IN comparisons, e.g.
11
+ * `WHERE Id = ${soqlLiteral(id)}`. Escapes backslashes (first, so escaped
12
+ * quotes aren't doubled), single quotes, and newline/tab control characters.
13
+ * Deliberately does NOT escape the LIKE wildcards `%`/`_` — inside an equality
14
+ * literal those are ordinary characters, and escaping them would change the
15
+ * compared value. For LIKE patterns / SOSL FIND terms use `escapeSoqlString`.
16
+ */
17
+ export declare const soqlLiteral: (value: string) => string;
18
+ /**
19
+ * Build the parenthesized value list for a SOQL IN clause, e.g.
20
+ * `WHERE Id IN ${soqlIn(ids)}`. An empty input yields `('')` — valid SOQL that
21
+ * matches no record — so callers don't need an empty-array branch.
22
+ */
23
+ export declare const soqlIn: (values: string[]) => string;
24
+ /**
25
+ * True when `name` is a plain SObject field API name (letters, digits,
26
+ * underscores, leading letter). Field identifiers cannot be escaped as string
27
+ * literals, so anything interpolated as a field/relationship name must pass
28
+ * this gate (relationship paths like `Contact__r.Id` need each dotted segment
29
+ * validated separately).
30
+ */
31
+ export declare const isSoqlFieldIdentifier: (name: string) => boolean;
32
+ /**
33
+ * Build a `field = 'value'` SOQL condition with the field validated via
34
+ * `isSoqlFieldIdentifier` and the value quoted via `soqlLiteral`. Throws on an
35
+ * invalid field name — field identifiers cannot be escaped, only rejected.
36
+ */
37
+ export declare const soqlEq: (field: string, value: string) => string;
2
38
  export declare const convertToSosl: (soqlQuery: string, searchString: string, searchInField?: string) => string | null;
3
39
  export interface AccountSortPriority {
4
40
  field: string;
@@ -1,3 +1,4 @@
1
+ import { User } from '../../types/openapi';
1
2
  export declare const splitUserName: (name?: string) => {
2
3
  first_name: string;
3
4
  last_name: string;
@@ -51,4 +52,21 @@ export declare function pickTemplateUserFields<T extends Record<string, any>>(us
51
52
  * without per-app code changes.
52
53
  */
53
54
  export declare function flattenUserProperties<T extends Record<string, any>>(user: T | null | undefined, schema?: CustomUserPropertiesSchema | null): T | null;
55
+ export interface CrmServiceLink {
56
+ /** Absolute URL opening the CRM web UI (e.g. the Salesforce custom domain). */
57
+ url: string;
58
+ /** Brand display name shown as the menu label — brand names are not translated. */
59
+ label: string;
60
+ /** Font Awesome icon name (without the `fa-` prefix). */
61
+ icon: string;
62
+ faType: 'fab' | 'far';
63
+ provider: string;
64
+ }
65
+ /**
66
+ * Resolve a browser link to the user's connected CRM from `connected_services`
67
+ * (the `/users/me/` response — `urls` is only populated on the `me`/`token` actions).
68
+ * Returns the first CRM service with a usable URL, or `null` when the user has
69
+ * no CRM connection to link to.
70
+ */
71
+ export declare function getCrmServiceLink(user: Pick<User, 'connected_services'> | null | undefined): CrmServiceLink | null;
54
72
  export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pitcher/js-api",
3
- "version": "1.28.0",
3
+ "version": "1.30.0",
4
4
  "type": "module",
5
5
  "main": "js-api.umd.min.js",
6
6
  "module": "js-api.esm.js",
@@ -134,7 +134,6 @@ export type { InstanceUpdateRequest } from './models/InstanceUpdateRequest';
134
134
  export type { Invitation } from './models/Invitation';
135
135
  export type { InvitationRequest } from './models/InvitationRequest';
136
136
  export { InvitationStatusEnum } from './models/InvitationStatusEnum';
137
- export { LanguageEnum } from './models/LanguageEnum';
138
137
  export type { MetadataTemplate } from './models/MetadataTemplate';
139
138
  export type { MetadataTemplateField } from './models/MetadataTemplateField';
140
139
  export type { MetadataTemplateFieldRequest } from './models/MetadataTemplateFieldRequest';
@@ -2,7 +2,6 @@ import { MiniUser } from './MiniUser';
2
2
  export type DeletedEnvironment = {
3
3
  readonly id: number;
4
4
  name: string;
5
- next_environment_ids?: Array<number>;
6
5
  color?: string | null;
7
6
  readonly created_at: string;
8
7
  readonly created_by: MiniUser;
@@ -2,7 +2,6 @@ import { MiniUser } from './MiniUser';
2
2
  export type Environment = {
3
3
  readonly id: number;
4
4
  name: string;
5
- next_environment_ids?: Array<number>;
6
5
  color?: string | null;
7
6
  readonly created_at: string;
8
7
  readonly created_by: MiniUser;
@@ -1,5 +1,4 @@
1
1
  export type EnvironmentRequest = {
2
2
  name: string;
3
- next_environment_ids?: Array<number>;
4
3
  color?: string | null;
5
4
  };
@@ -23,6 +23,8 @@ export type File = {
23
23
  readonly original_url: string | null;
24
24
  readonly thumbnail_url: string | null;
25
25
  download_type?: DownloadTypeEnum;
26
+ /** iOS bridge only — not returned by the REST API. */
27
+ readonly downloaded_at?: string | null;
26
28
  readonly zip_size: number | null;
27
29
  readonly zip_url: string | null;
28
30
  access_type?: AccessTypeEnum;
@@ -26,6 +26,8 @@ export type FileRetrieve = {
26
26
  readonly original_url: string | null;
27
27
  readonly thumbnail_url: string | null;
28
28
  download_type?: DownloadTypeEnum;
29
+ /** iOS bridge only — not returned by the REST API. */
30
+ readonly downloaded_at?: string | null;
29
31
  readonly zip_size: number | null;
30
32
  readonly zip_url: string | null;
31
33
  access_type?: AccessTypeEnum;
@@ -1,5 +1,4 @@
1
1
  export type PatchedEnvironmentRequest = {
2
2
  name?: string;
3
- next_environment_ids?: Array<number>;
4
3
  color?: string | null;
5
4
  };
@@ -1,10 +1,9 @@
1
- import { LanguageEnum } from './LanguageEnum';
2
1
  import { UserRoleEnum } from './UserRoleEnum';
3
2
  export type PatchedUserRequest = {
4
3
  first_name?: string;
5
4
  last_name?: string;
6
5
  role?: UserRoleEnum;
7
- language?: LanguageEnum;
6
+ language?: string;
8
7
  preferred_username?: string;
9
8
  timezone?: string;
10
9
  tags?: Array<string> | null;
@@ -1,5 +1,4 @@
1
1
  import { ConnectedService } from './ConnectedService';
2
- import { LanguageEnum } from './LanguageEnum';
3
2
  import { UserRoleEnum } from './UserRoleEnum';
4
3
  export type User = {
5
4
  readonly id: number;
@@ -16,7 +15,7 @@ export type User = {
16
15
  readonly deactivated_at: string | null;
17
16
  readonly activated_at: string | null;
18
17
  readonly is_active: boolean;
19
- language?: LanguageEnum;
18
+ language?: string;
20
19
  readonly connected_services: Array<ConnectedService>;
21
20
  preferred_username?: string;
22
21
  readonly picture: string | null;
@@ -1,10 +1,9 @@
1
- import { LanguageEnum } from './LanguageEnum';
2
1
  import { UserRoleEnum } from './UserRoleEnum';
3
2
  export type UserRequest = {
4
3
  first_name?: string;
5
4
  last_name?: string;
6
5
  role?: UserRoleEnum;
7
- language?: LanguageEnum;
6
+ language?: string;
8
7
  preferred_username?: string;
9
8
  timezone?: string;
10
9
  tags?: Array<string> | null;
@@ -1,8 +0,0 @@
1
- export type Language = [
2
- string,
3
- string
4
- ];
5
- /**
6
- * Fetches available languages for the logged-in user
7
- */
8
- export declare function getLanguages(): Promise<Language[]>;
@@ -1,12 +0,0 @@
1
- /**
2
- * * `en` - English
3
- * * `de` - Deutsch
4
- * * `pl` - Polski
5
- * * `tr` - Türkçe
6
- */
7
- export declare enum LanguageEnum {
8
- EN = "en",
9
- DE = "de",
10
- PL = "pl",
11
- TR = "tr"
12
- }