@pitcher/js-api 1.29.0 → 1.31.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/js-api.esm.js +488 -56
- package/js-api.esm.js.map +1 -1
- package/js-api.umd.min.js +32 -11
- package/js-api.umd.min.js.map +1 -1
- package/lib/ai-tasks/__tests__/weekly-focus.spec.d.ts +1 -0
- package/lib/ai-tasks/weekly-focus.d.ts +241 -0
- package/lib/apps/browser/appTypes.d.ts +28 -0
- package/lib/apps/browser/components/ContextMenu/TranslateFileButton.test.d.ts +1 -0
- package/lib/apps/browser/stores/api.d.ts +6 -1
- package/lib/apps/browser/stores/api.filesFoldersDeleter.test.d.ts +1 -0
- package/lib/apps/browser/stores/app.d.ts +5 -0
- package/lib/apps/browser/stores/app.selectionPruneScope.test.d.ts +1 -0
- package/lib/apps/browser/stores/upload.d.ts +26 -1
- package/lib/apps/browser/stores/upload.types.d.ts +9 -0
- package/lib/apps/browser/util/lifecycle.d.ts +57 -0
- package/lib/apps/browser/util/lifecycle.test.d.ts +1 -0
- package/lib/apps/canvas-builder/components/container/PopupApps/PopupAppModal.spec.d.ts +1 -0
- package/lib/apps/canvas-builder/components/container/PresentationTools/PresentationToolsButtons.spec.d.ts +1 -0
- package/lib/apps/canvas-builder/components/ui/BottomSheetModal/BottomSheetModal.integration.spec.d.ts +1 -0
- package/lib/apps/canvas-builder/components/ui/BottomSheetModal/BottomSheetModal.spec.d.ts +1 -0
- package/lib/apps/canvas-builder/components/ui/DynamicContent/section-component-bindings.util.d.ts +32 -0
- package/lib/apps/canvas-builder/components/ui/DynamicContent/useDynamicContent.d.ts +6 -0
- package/lib/apps/canvas-builder/components/ui/Link/Link.util.d.ts +8 -1
- package/lib/apps/canvas-builder/components/ui/Link/Link.util.test.d.ts +1 -0
- package/lib/apps/canvas-builder/components/ui/Multimedia/Multimedia.ldAsset.spec.d.ts +1 -0
- package/lib/apps/canvas-builder/components/ui/SectionList/SectionItemModal.spec.d.ts +1 -0
- package/lib/apps/canvas-builder/composables/useCanvas.d.ts +286 -10
- package/lib/apps/canvas-builder/composables/useCanvas.saveEcho.spec.d.ts +1 -0
- package/lib/apps/canvas-builder/composables/useCanvasBlocks.d.ts +40 -2
- package/lib/apps/canvas-builder/composables/useCanvasExit.d.ts +1 -0
- package/lib/apps/canvas-builder/composables/useCanvasHistory.d.ts +38 -2
- package/lib/apps/canvas-builder/composables/useCanvasTheme.d.ts +4 -2
- package/lib/apps/canvas-builder/composables/useContentSelector.d.ts +8 -1
- package/lib/apps/canvas-builder/composables/useInstalledEmbeddables.d.ts +1 -1
- package/lib/apps/canvas-builder/composables/useNavigatorDrawer.d.ts +27 -0
- package/lib/apps/canvas-builder/composables/useNavigatorDrawer.spec.d.ts +1 -0
- package/lib/apps/canvas-builder/composables/usePopupApps.d.ts +43 -4
- package/lib/apps/canvas-builder/composables/usePopupApps.spec.d.ts +1 -0
- package/lib/apps/canvas-builder/composables/usePresentationTools.d.ts +112 -0
- package/lib/apps/canvas-builder/composables/usePresentationTools.spec.d.ts +1 -0
- package/lib/apps/canvas-builder/types/canvas.d.ts +66 -3
- package/lib/apps/canvas-builder/util/canvas.util.d.ts +12 -0
- package/lib/apps/canvas-builder/util/completionWizard.util.d.ts +347 -0
- package/lib/apps/canvas-builder/util/completionWizard.util.test.d.ts +1 -0
- package/lib/apps/canvas-builder/util/fullscreenMode.util.d.ts +7 -0
- package/lib/apps/canvas-builder/util/fullscreenMode.util.test.d.ts +1 -0
- package/lib/apps/canvas-builder/util/iframe.util.d.ts +24 -2
- package/lib/apps/canvas-builder/util/iframe.util.test.d.ts +1 -0
- package/lib/apps/canvas-builder/util/lazySections.util.d.ts +35 -0
- package/lib/apps/canvas-builder/util/lazySections.util.test.d.ts +1 -0
- package/lib/apps/canvas-selector/stores/app.d.ts +14 -0
- package/lib/apps/collection-player/components/AppHeader.spec.d.ts +1 -0
- package/lib/apps/collection-player/composables/collection-navigation.util.d.ts +27 -0
- package/lib/apps/collection-player/composables/collection-navigation.util.spec.d.ts +1 -0
- package/lib/apps/collection-player/composables/speaker-notes.use.d.ts +14 -0
- package/lib/apps/collection-player/composables/speaker-notes.use.spec.d.ts +1 -0
- package/lib/apps/collection-player/stores/app.store.d.ts +8 -1
- package/lib/apps/collection-player/stores/showNotesToggle.spec.d.ts +1 -0
- package/lib/apps/content-selector/appTypes.d.ts +16 -0
- package/lib/apps/content-selector/components/Assets.uploaderRefresh.spec.d.ts +1 -0
- package/lib/apps/content-selector/components/Content/AllContent/List/expandFileGuard.spec.d.ts +1 -0
- package/lib/apps/content-selector/stores/app.d.ts +1 -1
- package/lib/apps/notes/NotesApp.accountNotes.spec.d.ts +1 -0
- package/lib/apps/notes/NotesApp.speakerNotes.spec.d.ts +1 -0
- package/lib/apps/notes/composables/useAccountNotes.d.ts +14 -0
- package/lib/apps/notes/composables/useAccountNotes.spec.d.ts +1 -0
- package/lib/apps/notes/composables/useAccountOnlyNotesGate.d.ts +21 -0
- package/lib/apps/notes/composables/useAccountOnlyNotesGate.spec.d.ts +1 -0
- package/lib/apps/notes/composables/useActiveSlideNotes.d.ts +42 -0
- package/lib/apps/notes/composables/useActiveSlideNotes.spec.d.ts +1 -0
- package/lib/components/CFileAccessManagement/collaborationApi.d.ts +2 -0
- package/lib/components/CFilePanel/Details.spec.d.ts +1 -0
- package/lib/components/CFilePanel/KeyMessages.spec.d.ts +1 -0
- package/lib/components/CFilePanel/Summary.spec.d.ts +1 -0
- package/lib/components/CFileViewer/pdf/CFileViewer.pdf.annotations.use.d.ts +5 -1
- package/lib/components/CFileViewer/pdf/CFileViewer.pdf.formFields.use.d.ts +8 -0
- package/lib/components/CFileViewer/pdf/CFileViewer.pdf.link.use.d.ts +1 -1
- package/lib/components/CFileViewer/pdf/CFileViewer.pdf.overlayItems.use.d.ts +1 -1
- package/lib/components/CFileViewer/pdf/CFileViewer.pdf.use.d.ts +4 -9
- package/lib/components/CFileViewer/pdf/CFileViewer.pdf.util.d.ts +53 -1
- package/lib/components/CFileViewer/pdf/CFileViewerFullscreen.pdf.use.d.ts +1 -1
- package/lib/components/CFileViewer/pdf/__tests__/CFileViewer.pdf.annotations.text.test.d.ts +1 -0
- package/lib/components/CGlobalLoader/CGlobalLoaderMark.spec.d.ts +1 -0
- package/lib/components/CGlobalLoader/globalLoader.paths.d.ts +2 -0
- package/lib/components/CGlobalSearch/globalSearchTarget.util.d.ts +31 -0
- package/lib/components/CGlobalSearch/globalSearchTarget.util.test.d.ts +1 -0
- package/lib/components/CRichTextEditor/extensions/paragraphExtended.d.ts +7 -1
- package/lib/components/CRichTextEditor/extensions/paragraphExtended.test.d.ts +1 -0
- package/lib/components/canvases/CanvasesManagementBulk.use.d.ts +12 -2
- package/lib/components/masterCanvases/CMasterCanvasesManagement.use.d.ts +86 -0
- package/lib/components/masterCanvases/CMasterCanvasesManagement.use.spec.d.ts +1 -0
- package/lib/components/masterCanvases/CMasterCanvasesPendingShareCell.spec.d.ts +1 -0
- package/lib/components/masterCanvases/CMasterCanvasesSharedWithCell.use.d.ts +39 -0
- package/lib/components/masterCanvases/CMasterCanvasesSharedWithCell.use.spec.d.ts +1 -0
- package/lib/components/masterCanvases/createFromMaster.use.d.ts +255 -0
- package/lib/components/masterCanvases/createFromMaster.use.spec.d.ts +1 -0
- package/lib/components/masterCanvases/masterCanvasDocuments.use.d.ts +56 -0
- package/lib/components/masterCanvases/masterCanvasDocuments.use.spec.d.ts +1 -0
- package/lib/components/masterCanvases/masterCanvasShares.use.d.ts +103 -0
- package/lib/components/masterCanvases/masterCanvasShares.use.spec.d.ts +1 -0
- package/lib/components/masterCanvases/masterFromCanvas.use.d.ts +122 -0
- package/lib/components/masterCanvases/masterFromCanvas.use.spec.d.ts +1 -0
- package/lib/components/masterCanvases/masterFromTemplate.use.d.ts +50 -0
- package/lib/components/masterCanvases/masterFromTemplate.use.spec.d.ts +1 -0
- package/lib/components/savedCanvases/CSavedCanvasesManagement.use.d.ts +204 -0
- package/lib/components/savedCanvases/savedCanvasDocuments.use.d.ts +111 -0
- package/lib/components/savedCanvases/savedCanvasDocuments.use.spec.d.ts +1 -0
- package/lib/components/savedCanvases/smartFolders/SmartFolders.use.d.ts +4 -0
- package/lib/composables/useCourseOnlyApps.d.ts +1 -1
- package/lib/composables/usePdfInterpolation.d.ts +2 -2
- package/lib/composables/useWindowEvents.d.ts +1 -1
- package/lib/constants/cdp.const.d.ts +2 -0
- package/lib/constants/translationLanguages.const.d.ts +150 -0
- package/lib/constants/translationLanguages.const.spec.d.ts +1 -0
- package/lib/main.lib.d.ts +7 -0
- package/lib/sdk/api/HighLevelApi.d.ts +19 -6
- package/lib/sdk/api/modules/ai.d.ts +43 -1
- package/lib/sdk/api/modules/ai.spec.d.ts +1 -0
- package/lib/sdk/api/modules/appsDb.d.ts +4 -4
- package/lib/sdk/api/modules/canvas.d.ts +20 -0
- package/lib/sdk/api/modules/ui/types.ui.d.ts +25 -0
- package/lib/sdk/interfaces.d.ts +31 -1
- package/lib/sdk/main.d.ts +46 -0
- package/lib/sdk/payload.types.d.ts +149 -0
- package/lib/sdk/platform.d.ts +27 -0
- package/lib/sdk/platform.spec.d.ts +1 -0
- package/lib/sdk/singleton-scope.spec.d.ts +1 -0
- package/lib/sdk/utils/httpFetch.spec.d.ts +1 -0
- package/lib/theme/canvasUiUnoPreset.test.d.ts +1 -0
- package/lib/types/ai-tasks.const.d.ts +39 -1
- package/lib/types/app.d.ts +55 -1
- package/lib/types/call.d.ts +14 -0
- package/lib/types/canvases.d.ts +15 -0
- package/lib/types/launchDarkly.types.d.ts +8 -3
- package/lib/types/organizationSettings.types.d.ts +39 -0
- package/lib/util/aiSummary.d.ts +30 -0
- package/lib/util/aiSummary.spec.d.ts +1 -0
- package/lib/util/network.d.ts +35 -0
- package/lib/util/user.d.ts +18 -0
- package/lib/util/user.test.d.ts +1 -0
- package/package.json +1 -1
- package/types/openapi/models/Canvas.d.ts +1 -0
- package/types/openapi/models/CanvasCreate.d.ts +1 -0
- package/types/openapi/models/CanvasCreateRequest.d.ts +1 -0
- package/types/openapi/models/CanvasRecommendedFile.d.ts +1 -1
- package/types/openapi/models/CanvasRetrieve.d.ts +1 -0
- package/types/openapi/models/CanvasUpdate.d.ts +1 -0
- package/types/openapi/models/CanvasUpdateRequest.d.ts +1 -0
- package/types/openapi/models/DeletedCanvas.d.ts +1 -0
- package/types/openapi/models/DeletedEnvironment.d.ts +0 -1
- package/types/openapi/models/Environment.d.ts +0 -1
- package/types/openapi/models/EnvironmentRequest.d.ts +0 -1
- package/types/openapi/models/File.d.ts +3 -1
- package/types/openapi/models/FileRetrieve.d.ts +2 -0
- package/types/openapi/models/PatchedCanvasUpdateRequest.d.ts +1 -0
- package/types/openapi/models/PatchedEnvironmentRequest.d.ts +0 -1
- package/types/openapi/models/SharedLink.d.ts +6 -0
- package/types/openapi/models/SharedLinkCreateRequest.d.ts +5 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Target languages offered by the content-translation feature.
|
|
3
|
+
*
|
|
4
|
+
* ⚠️ MIRROR — the single source of truth is
|
|
5
|
+
* `packages/next-core/src/services/translation/languages.ts`
|
|
6
|
+
* (`TRANSLATION_LANGUAGES`). next-core cannot be imported from canvas-ui or the
|
|
7
|
+
* admin client, so the list is duplicated here for the UI pickers only. Keep the
|
|
8
|
+
* `locale` values byte-identical with that file: the backend resolves the DeepL
|
|
9
|
+
* target code and the English language name from the locale we post, so a locale
|
|
10
|
+
* that exists here and not there is rejected by the route.
|
|
11
|
+
*
|
|
12
|
+
* The admin client imports this from `@pitcher/canvas-ui` rather than keeping a
|
|
13
|
+
* third copy, so there are exactly two lists to reconcile, never more.
|
|
14
|
+
*
|
|
15
|
+
* `label` is intentionally NOT an i18n key: language names are shown in their own
|
|
16
|
+
* language (the endonym), which is what every locale picker in the product does,
|
|
17
|
+
* and it keeps the list free of the dynamic-key lookups the i18n extractor strips.
|
|
18
|
+
* That is also what lets this list exceed the shipped locales without any i18n work.
|
|
19
|
+
*
|
|
20
|
+
* ⚠️ THE LITERAL ORDER IS THE DISPLAY ORDER. Entries are sorted by `label`, the
|
|
21
|
+
* string the admin actually reads: Latin alphabetically, then Greek, Cyrillic,
|
|
22
|
+
* Devanagari, Thai, Hangul, CJK, which is what `Intl.Collator` yields. Sorting by
|
|
23
|
+
* `locale` reads better in a diff and was the original order, but it only looked
|
|
24
|
+
* alphabetical by accident while the list was 14 Latin-ish languages — at 24 it put
|
|
25
|
+
* Suomi between Español and Français. The pickers do not sort, so this list must.
|
|
26
|
+
*
|
|
27
|
+
* ⚠️ These are NOT all platform UI locales. The original 14 were, which is why an
|
|
28
|
+
* older version of this comment said so; the 10 added on 2026-08-11 (cs, da, fi,
|
|
29
|
+
* hi, id, ko, nb, ru, sv, vi) have no `locale/<code>.json`. Translating CONTENT is
|
|
30
|
+
* not localising the PRODUCT, and nothing here loads a bundle from `locale`.
|
|
31
|
+
*
|
|
32
|
+
* ⚠️ Every entry must stay selectable — the admin client maps this list straight to
|
|
33
|
+
* Vuetify items with no `disabled` prop and no filtering, which is deliberate. Do
|
|
34
|
+
* not add a per-language disabled/beta flag; a language that cannot be served by
|
|
35
|
+
* both translation legs should not be in the list. That is why Arabic and Hebrew
|
|
36
|
+
* are absent despite DeepL supporting them: the product has no RTL rendering, so a
|
|
37
|
+
* translated canvas would lay out left-to-right.
|
|
38
|
+
*/
|
|
39
|
+
export interface TranslationLanguageOption {
|
|
40
|
+
/** Target-language key posted to the backend. NOT necessarily a shipped UI locale. */
|
|
41
|
+
locale: string;
|
|
42
|
+
/** Endonym shown in the picker. */
|
|
43
|
+
label: string;
|
|
44
|
+
/**
|
|
45
|
+
* English name of the language, used ONLY to make the picker searchable.
|
|
46
|
+
*
|
|
47
|
+
* ⚠️ Load-bearing for `filterable` pickers. Naive UI's default filter matches
|
|
48
|
+
* `option.label`, and `label` is the endonym — so without this an admin typing
|
|
49
|
+
* "swedish" gets "No data" for Svenska, and likewise for 9 other entries. The
|
|
50
|
+
* filter must be given explicitly and must test BOTH fields; see
|
|
51
|
+
* `translationLanguageOptions`.
|
|
52
|
+
*/
|
|
53
|
+
englishName: string;
|
|
54
|
+
/** Uppercase suffix the backend appends to a translated record's name. */
|
|
55
|
+
suffix: string;
|
|
56
|
+
}
|
|
57
|
+
export declare const TRANSLATION_LANGUAGES: readonly TranslationLanguageOption[];
|
|
58
|
+
/**
|
|
59
|
+
* Uppercase language suffix of a TRANSLATED record, read from the provenance stamp
|
|
60
|
+
* `metadata.pitcher.translation.language` that the duplicate-translate route writes.
|
|
61
|
+
* Returns undefined for an untranslated record or an unrecognised locale, so a caller
|
|
62
|
+
* can use the result directly as the "show a badge" condition.
|
|
63
|
+
*/
|
|
64
|
+
export declare function translatedLanguageSuffix(metadata: unknown): string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* File extensions the row action and the upload picker offer.
|
|
67
|
+
*
|
|
68
|
+
* ⚠️ MIRROR — the source of truth is `DEEPL_SUPPORTED_EXTENSIONS` in
|
|
69
|
+
* `packages/next-core/src/services/deepl.service.ts`, which is what the
|
|
70
|
+
* `files/translate` route actually validates against. Every entry here MUST exist
|
|
71
|
+
* there, or the UI offers a translation the route answers with
|
|
72
|
+
* `400 invalid_request`.
|
|
73
|
+
*
|
|
74
|
+
* Legacy `.doc` and `.ppt` are deliberately absent: DeepL rejects the legacy
|
|
75
|
+
* binary formats, so offering them only produced that 400. The DeepL list is a
|
|
76
|
+
* superset (it also accepts `xlf`, `xliff`, `srt`); those stay out of the UI until
|
|
77
|
+
* there is a reason to surface localisation-interchange formats to admins, and a
|
|
78
|
+
* subset is safe in a way a superset is not.
|
|
79
|
+
*/
|
|
80
|
+
export declare const TRANSLATABLE_FILE_EXTENSIONS: readonly string[];
|
|
81
|
+
export declare function isTranslatableFileExtension(extension?: string | null): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Extension of a file record, resolved the way the route resolves it.
|
|
84
|
+
*
|
|
85
|
+
* ⚠️ MIRROR of `resolveExtension` in
|
|
86
|
+
* `packages/next-core/src/services/translation/translated-file.ts`: prefer
|
|
87
|
+
* `content_extension`, then `extension`, then parse the name. Keep the two in
|
|
88
|
+
* step — a gate that disagrees with the route either hides a supported file or
|
|
89
|
+
* offers one the route will reject.
|
|
90
|
+
*
|
|
91
|
+
* `content_extension` comes first because it is the closest thing the list
|
|
92
|
+
* payload has to the rendition, and it is nearer to what the route declares to
|
|
93
|
+
* DeepL. Resolving `original_extension` first offered the action for a
|
|
94
|
+
* PDF-converted deck as `pptx`, so the button appeared and the upload then
|
|
95
|
+
* failed on bytes that are a PDF.
|
|
96
|
+
*
|
|
97
|
+
* ⚠️ `content_extension` does NOT describe the bytes actually stored. It records
|
|
98
|
+
* the UPLOAD. Django derives the served rendition from `content_type` alone
|
|
99
|
+
* (`get_content_url`), which is why the route resolves from `content_url` and
|
|
100
|
+
* this gate can only approximate it. Do not restate the stronger claim: it was
|
|
101
|
+
* wrong, and believing it cost three defects on PIT-7916.
|
|
102
|
+
*
|
|
103
|
+
* ⚠️ The chain is deliberately LONGER than the route's, and `original_extension`
|
|
104
|
+
* must stay in it. The two read different payloads:
|
|
105
|
+
*
|
|
106
|
+
* - This gate runs over the **folder/list** payload, which carries ONLY
|
|
107
|
+
* `original_extension` (verified against `GET /api/v1/folders/{id}/`: no
|
|
108
|
+
* `content_extension`, no `extension`). Drop it here and every file in the
|
|
109
|
+
* content browser resolves `''` and loses the action.
|
|
110
|
+
* - The route re-resolves from the **detail** payload
|
|
111
|
+
* (`GET /api/v1/files/{id}/`), which always carries `content_extension`, so it
|
|
112
|
+
* never needs the pre-conversion value and must not trust it.
|
|
113
|
+
*
|
|
114
|
+
* So a converted deck shows the action as `pptx` and then translates as `pdf`,
|
|
115
|
+
* which is correct in both places. The name parse survives as the last resort
|
|
116
|
+
* for records with no extension column at all.
|
|
117
|
+
*/
|
|
118
|
+
export declare function resolveFileExtension(file?: {
|
|
119
|
+
name?: string | null;
|
|
120
|
+
content_extension?: string | null;
|
|
121
|
+
extension?: string | null;
|
|
122
|
+
original_extension?: string | null;
|
|
123
|
+
} | null): string;
|
|
124
|
+
/**
|
|
125
|
+
* Naive UI / CSelect option shape for the language pickers.
|
|
126
|
+
*
|
|
127
|
+
* `englishName` rides along so a `filterable` picker can search it — see
|
|
128
|
+
* `translationLanguageFilter`, which such a picker MUST be given.
|
|
129
|
+
*/
|
|
130
|
+
export declare function translationLanguageOptions(): {
|
|
131
|
+
label: string;
|
|
132
|
+
englishName: string;
|
|
133
|
+
value: string;
|
|
134
|
+
}[];
|
|
135
|
+
/**
|
|
136
|
+
* Filter for a `filterable` language picker, matching the endonym OR the English name.
|
|
137
|
+
*
|
|
138
|
+
* ⚠️ Pass this explicitly. Naive UI's default filter tests `option.label` only, and
|
|
139
|
+
* `label` is the endonym, so the default silently returns "No data" for every
|
|
140
|
+
* language an English-speaking admin would type the name of: Čeština, Dansk, Suomi,
|
|
141
|
+
* हिन्दी, Bahasa Indonesia, 한국어, Norsk bokmål, Русский, Svenska, Tiếng Việt, plus
|
|
142
|
+
* Ελληνικά, 日本語, ไทย and 中文. That is 14 of 24, and it fails silently rather than
|
|
143
|
+
* visibly, which is why it went unnoticed while the list was small.
|
|
144
|
+
*
|
|
145
|
+
* Accent-insensitive on the pattern side too, so "cestina" finds Čeština.
|
|
146
|
+
*/
|
|
147
|
+
export declare function translationLanguageFilter(pattern: string, option: {
|
|
148
|
+
label?: string;
|
|
149
|
+
englishName?: string;
|
|
150
|
+
}): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/main.lib.d.ts
CHANGED
|
@@ -86,6 +86,7 @@ export { default as CAssignedCanvasesManagement } from './components/assignedCan
|
|
|
86
86
|
export { default as CAssignedCanvasesManagementToolbar } from './components/assignedCanvases/CAssignedCanvasesManagementToolbar.vue';
|
|
87
87
|
export { default as useShareCanvas } from './components/savedCanvases/CSavedCanvasesManagementShareCanvas.use';
|
|
88
88
|
export { getFreezeStatus, SYSTEM_EXCLUDED_TAGS, type FreezeStatus } from './components/savedCanvases/CSavedCanvasesManagement.use';
|
|
89
|
+
export { buildMasterFromTemplatePayload, type MasterFromTemplatePayload, type MasterTemplateSource, } from './components/masterCanvases/masterFromTemplate.use';
|
|
89
90
|
export { default as CConfigEditor } from './components/CConfigEditor/CConfigEditor.vue';
|
|
90
91
|
export { default as CTableInput } from './components/CTableInput/CTableInput.vue';
|
|
91
92
|
export { default as CTableTag } from './components/CTableTag/CTableTag.vue';
|
|
@@ -106,6 +107,7 @@ export { default as CFileViewer } from './components/CFileViewer/CFileViewer.vue
|
|
|
106
107
|
export { default as CDetailPageSectionButtons } from './components/CDetailPageSectionButtons/CDetailPageSectionButtons.vue';
|
|
107
108
|
export { default as CFullScreenLoader } from './components/CFullScreenLoader/CFullScreenLoader.vue';
|
|
108
109
|
export { default as CGlobalLoader } from './components/CGlobalLoader/CGlobalLoader.vue';
|
|
110
|
+
export { default as CGlobalLoaderMark } from './components/CGlobalLoader/CGlobalLoaderMark.vue';
|
|
109
111
|
export { default as CFilesFolderDeleteDialogContent } from './components/CFilesFolderDeleteDialogContent/CFilesFolderDeleteDialogContent.vue';
|
|
110
112
|
export { default as CCatalogIqSwitcher } from './components/CCatalogIqSwitcher/CCatalogIqSwitcher.vue';
|
|
111
113
|
export { default as CCarousel } from './components/CCarousel/CCarousel.vue';
|
|
@@ -138,6 +140,9 @@ export { default as CanvasSelector } from './apps/canvas-selector/App.vue';
|
|
|
138
140
|
export type { CanvasSelection } from './apps/canvas-selector/appTypes';
|
|
139
141
|
export { default as NotesApp } from './apps/notes/NotesApp.vue';
|
|
140
142
|
export { default as useNotesApp } from './apps/notes/composables/useNotesApp';
|
|
143
|
+
export { useAccountNotes, accountNotesBucketKey, NOTES_APP_CONTENT_KEY } from './apps/notes/composables/useAccountNotes';
|
|
144
|
+
export { useAccountOnlyNotesGate } from './apps/notes/composables/useAccountOnlyNotesGate';
|
|
145
|
+
export { ACTIVE_SLIDE_NOTES_KEY, clearActiveSlideNotes, setActiveSlideNotes, useActiveSlideNotes, type ActiveSlideNotes, } from './apps/notes/composables/useActiveSlideNotes';
|
|
141
146
|
export { default as AssetsManagerApp } from './apps/assets-manager/App.vue';
|
|
142
147
|
export type { AppProps as AssetsManagerProps } from './apps/assets-manager/App.vue';
|
|
143
148
|
export * as pptConversionSelector from './apps/ppt-conversion-selector/export';
|
|
@@ -178,6 +183,7 @@ export { usePolling } from './composables/usePolling';
|
|
|
178
183
|
export { default as useBroadcastRouteChange } from './composables/useBroadcastRouteChange';
|
|
179
184
|
export * from './plugins/vueQuery';
|
|
180
185
|
export * from './apps/canvas-builder/util/canvas.util';
|
|
186
|
+
export * from './apps/canvas-builder/util/completionWizard.util';
|
|
181
187
|
export * from './apps/canvas-builder/util/tree';
|
|
182
188
|
export * from './apps/canvas-builder/util/print.util';
|
|
183
189
|
export * from './components/filters/filter.util';
|
|
@@ -267,6 +273,7 @@ export * from './constants/conventions.const';
|
|
|
267
273
|
export * from './constants/config.const';
|
|
268
274
|
export * from './constants/pitcherSettings.const';
|
|
269
275
|
export * from './constants/appsDb.const';
|
|
276
|
+
export * from './constants/translationLanguages.const';
|
|
270
277
|
export * from './apps/canvas-builder/constants/theme.const';
|
|
271
278
|
export * from './constants/roles.const';
|
|
272
279
|
export type { RolePermissions } from './constants/roles.const';
|
|
@@ -122,9 +122,11 @@ export declare function createHighLevelApi(options?: ApiOptions): {
|
|
|
122
122
|
* @returns {Promise<void>}
|
|
123
123
|
*/
|
|
124
124
|
unsubscribe: () => Promise<any>;
|
|
125
|
+
postJsonWithTimeout<T>(url: string, body: unknown, accessToken: string, timeoutMs: number, label: string): Promise<T>;
|
|
125
126
|
aiGetCapabilities(): Promise<import('../payload.types').AIRuntimeCapabilities>;
|
|
126
127
|
aiComplete(payload: import('../payload.types').AICompletePayload): Promise<import('../payload.types').AICompleteResult>;
|
|
127
128
|
piaSearchAnswer(payload: import('../payload.types').PiaSearchAnswerPayload): Promise<import('../payload.types').PiaSearchAnswerResult>;
|
|
129
|
+
weeklyFocusRank(payload: import('../payload.types').WeeklyFocusRankPayload): Promise<import('../payload.types').WeeklyFocusRankResult>;
|
|
128
130
|
appsDbGetEntries(payload: import('../payload.types').AppsDbGetEntriesPayload): Promise<import('../payload.types').AppsDbEntriesResult>;
|
|
129
131
|
appsDbUpsertEntry(payload: import('../payload.types').AppsDbUpsertEntryPayload): Promise<import('../payload.types').AppsDbEntry>;
|
|
130
132
|
appsDbDeleteEntry(payload: import('../payload.types').AppsDbDeleteEntryPayload): Promise<void>;
|
|
@@ -147,7 +149,20 @@ export declare function createHighLevelApi(options?: ApiOptions): {
|
|
|
147
149
|
updateCanvas(payload: import('../../main.lib').PatchedCanvasUpdateRequest & {
|
|
148
150
|
id: import('../../main.lib').CanvasRetrieve["id"];
|
|
149
151
|
instance_id?: import('../../main.lib').Instance["id"];
|
|
150
|
-
fields
|
|
152
|
+
fields
|
|
153
|
+
/**
|
|
154
|
+
* Make the entire CatalogIQ fullscreen.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* usePitcherApi().enterFullscreen()
|
|
158
|
+
*/
|
|
159
|
+
? /**
|
|
160
|
+
* Make the entire CatalogIQ fullscreen.
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* usePitcherApi().enterFullscreen()
|
|
164
|
+
*/: string;
|
|
165
|
+
lazy_sections?: boolean;
|
|
151
166
|
}): Promise<import('../../main.lib').CanvasRetrieve>;
|
|
152
167
|
updateCanvasIndicators(payload: {
|
|
153
168
|
indicators: Record<string, import('../../main.lib').CanvasIndicator>;
|
|
@@ -157,11 +172,8 @@ export declare function createHighLevelApi(options?: ApiOptions): {
|
|
|
157
172
|
getCanvas(payload: {
|
|
158
173
|
id: import('../../main.lib').CanvasRetrieve["id"];
|
|
159
174
|
fields?: string;
|
|
160
|
-
lazy_sections
|
|
161
|
-
|
|
162
|
-
*
|
|
163
|
-
* @returns {Promise<void>}
|
|
164
|
-
*/: boolean;
|
|
175
|
+
lazy_sections?: boolean;
|
|
176
|
+
skip_error_toast?: boolean;
|
|
165
177
|
}): Promise<import('../../main.lib').CanvasRetrieve>;
|
|
166
178
|
getSectionsByIds(payload: {
|
|
167
179
|
canvas_id: import('../../main.lib').CanvasRetrieve["id"];
|
|
@@ -174,6 +186,7 @@ export declare function createHighLevelApi(options?: ApiOptions): {
|
|
|
174
186
|
}>;
|
|
175
187
|
shareCanvas(payload: {
|
|
176
188
|
id: import('../../main.lib').CanvasRetrieve["id"];
|
|
189
|
+
brand_id?: string;
|
|
177
190
|
}): Promise<import('../../main.lib').SharedLink>;
|
|
178
191
|
getCanvasRecommendedFiles(payload: {
|
|
179
192
|
canvas_id: import('../../main.lib').CanvasRetrieve["id"];
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
import { AICompletePayload, AICompleteResult, AIRuntimeCapabilities, PiaSearchAnswerPayload, PiaSearchAnswerResult } from '../../payload.types';
|
|
1
|
+
import { AICompletePayload, AICompleteResult, AIRuntimeCapabilities, PiaSearchAnswerPayload, PiaSearchAnswerResult, WeeklyFocusRankPayload, WeeklyFocusRankResult } from '../../payload.types';
|
|
2
|
+
/**
|
|
3
|
+
* POST JSON to a next-core route with a hard deadline, returning the parsed body.
|
|
4
|
+
* The shared scaffold behind the SDK's online AI calls (`piaSearchAnswer`,
|
|
5
|
+
* `weeklyFocusRank`).
|
|
6
|
+
*
|
|
7
|
+
* Bounds the WHOLE request including the body read: `fetch()` resolves on headers
|
|
8
|
+
* alone, so reading `.json()` INSIDE the timed window (and letting the abort
|
|
9
|
+
* cancel that read too — hence `clearTimeout` in `finally`) is what stops a
|
|
10
|
+
* response that stalls mid-body from hanging unbounded. `label` names the route
|
|
11
|
+
* in BOTH the non-2xx error (`<label> <status>`) and the timeout error, so each
|
|
12
|
+
* caller keeps its exact error strings.
|
|
13
|
+
*/
|
|
14
|
+
export declare function postJsonWithTimeout<T>(url: string, body: unknown, accessToken: string, timeoutMs: number, label: string): Promise<T>;
|
|
2
15
|
/**
|
|
3
16
|
* Capabilities of the AI completion runtime on the current platform.
|
|
4
17
|
*
|
|
@@ -50,3 +63,32 @@ export declare function aiComplete(payload: AICompletePayload): Promise<AIComple
|
|
|
50
63
|
* console.log(result.answer, result.cited_file_ids, result.source)
|
|
51
64
|
*/
|
|
52
65
|
export declare function piaSearchAnswer(payload: PiaSearchAnswerPayload): Promise<PiaSearchAnswerResult>;
|
|
66
|
+
/**
|
|
67
|
+
* Rank the rep's next-7-days meetings by how much preparation they need — the
|
|
68
|
+
* ONE high-level Weekly Focus call (PIT-7257), the `weekly_focus` AITask.
|
|
69
|
+
*
|
|
70
|
+
* The on-device path runs the prompt, window, parser and ordinal resolver from
|
|
71
|
+
* `@lib/ai-tasks/weekly-focus`; the online route runs next-core's parallel copy
|
|
72
|
+
* of the same logic. The two are kept in lockstep by matching test suites, not a
|
|
73
|
+
* shared import (see that module's header / ADR-002), so the two paths produce
|
|
74
|
+
* the same shape:
|
|
75
|
+
*
|
|
76
|
+
* - iOS with an available local model → `aiComplete` over the caller-supplied
|
|
77
|
+
* meetings + account context. Unavailable models / unusable output fall through.
|
|
78
|
+
* - Otherwise → POST to the next-core Bedrock route.
|
|
79
|
+
*
|
|
80
|
+
* The model picks meetings by ORDINAL and the resolver maps them back to
|
|
81
|
+
* event_ids, dropping out-of-range ones — so a returned id can only come from
|
|
82
|
+
* the `meetings` passed in.
|
|
83
|
+
*
|
|
84
|
+
* This does NOT cache, lock or prewarm: an app that generates on a schedule (as
|
|
85
|
+
* pre-call-brief does) owns those mechanics and calls this underneath.
|
|
86
|
+
*
|
|
87
|
+
* @param {WeeklyFocusRankPayload} payload - The meetings + optional account context.
|
|
88
|
+
* @returns {Promise<WeeklyFocusRankResult>} - Ranking with the serving `source`.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* const focus = await api.weeklyFocusRank({ meetings, context })
|
|
92
|
+
* console.log(focus.hero, focus.top, focus.collapsed_count)
|
|
93
|
+
*/
|
|
94
|
+
export declare function weeklyFocusRank(payload: WeeklyFocusRankPayload): Promise<WeeklyFocusRankResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { AppsDbDeleteEntryPayload, AppsDbEntriesResult, AppsDbEntry, AppsDbGetEn
|
|
|
2
2
|
/**
|
|
3
3
|
* Lists AppsDB entries of a type, adapting to the platform:
|
|
4
4
|
* - Web: GET to the next-core AppsDB REST API.
|
|
5
|
-
* -
|
|
5
|
+
* - Native (iPad or desktop): reads the local offline mirror via the `appsdb_get_entries` bridge
|
|
6
6
|
* request. Types not allowlisted in the `offline_appsdb_types` setting fail
|
|
7
7
|
* with `code = type_not_synced` and automatically fall back to the network.
|
|
8
8
|
*
|
|
@@ -13,7 +13,7 @@ export declare function appsDbGetEntries(payload: AppsDbGetEntriesPayload): Prom
|
|
|
13
13
|
/**
|
|
14
14
|
* Creates or updates (deep-merges) an AppsDB entry, adapting to the platform:
|
|
15
15
|
* - Web: POST (create) or PUT (update, when `id` is set) to the next-core AppsDB REST API.
|
|
16
|
-
* -
|
|
16
|
+
* - Native (iPad or desktop): the `appsdb_upsert_entry` bridge request writes on the server and
|
|
17
17
|
* mirrors the authoritative result locally. Offline it rejects with
|
|
18
18
|
* `code = offline_write_not_supported` — AppsDB writes are online-only.
|
|
19
19
|
*
|
|
@@ -28,7 +28,7 @@ export declare function appsDbUpsertEntry(payload: AppsDbUpsertEntryPayload): Pr
|
|
|
28
28
|
/**
|
|
29
29
|
* Deletes an AppsDB entry (soft delete server-side), adapting to the platform:
|
|
30
30
|
* - Web: DELETE to the next-core AppsDB REST API.
|
|
31
|
-
* -
|
|
31
|
+
* - Native (iPad or desktop): the `appsdb_delete_entry` bridge request deletes on the server and
|
|
32
32
|
* removes the entry from the local offline mirror. Offline it rejects with
|
|
33
33
|
* `code = offline_write_not_supported`.
|
|
34
34
|
*
|
|
@@ -40,7 +40,7 @@ export declare function appsDbDeleteEntry(payload: AppsDbDeleteEntryPayload): Pr
|
|
|
40
40
|
* Runs a PSQL (SQL-like) query against AppsDB: POST to the next-core
|
|
41
41
|
* `/appsdb/psql` endpoint whenever the network is available.
|
|
42
42
|
*
|
|
43
|
-
* On
|
|
43
|
+
* On a native host the local offline mirror (`appsdb_get_entries` + client-side
|
|
44
44
|
* evaluation of simple `field = literal` AND-chains) serves the query ONLY
|
|
45
45
|
* while the device is offline, or when an online fetch fails at the
|
|
46
46
|
* connection level. Online queries are always answered by the server: Hub
|
|
@@ -44,6 +44,14 @@ export declare function updateCanvas(payload: PatchedCanvasUpdateRequest & {
|
|
|
44
44
|
id: CanvasRetrieve['id'];
|
|
45
45
|
instance_id?: Instance['id'];
|
|
46
46
|
fields?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Request the lazy "shell" on the PATCH response (section stubs +
|
|
49
|
+
* `section_ids` instead of expanded bodies). No-op unless the instance's
|
|
50
|
+
* `lazy_load_sections` setting is on (server-side double-gate). With a
|
|
51
|
+
* `fields` list that excludes `sections`, the response is byte-identical —
|
|
52
|
+
* only the server-side cost drops (PIT-7073).
|
|
53
|
+
*/
|
|
54
|
+
lazy_sections?: boolean;
|
|
47
55
|
}): Promise<CanvasRetrieve>;
|
|
48
56
|
/**
|
|
49
57
|
* Updates canvas indicators by canvas ID. It merges the passed object into existing canvas indicators adding new keys if they were empty and overriding pre-existing keys.
|
|
@@ -83,6 +91,8 @@ export declare function getCanvas(payload: {
|
|
|
83
91
|
id: CanvasRetrieve['id'];
|
|
84
92
|
fields?: string;
|
|
85
93
|
lazy_sections?: boolean;
|
|
94
|
+
/** Suppress the host's error toast for best-effort reads (e.g. download-completion polling). */
|
|
95
|
+
skip_error_toast?: boolean;
|
|
86
96
|
}): Promise<CanvasRetrieve>;
|
|
87
97
|
/**
|
|
88
98
|
* Batch-hydrate section bodies for a canvas fetched as a lazy shell.
|
|
@@ -115,8 +125,18 @@ export declare function getSectionsByIds(payload: {
|
|
|
115
125
|
}): Promise<{
|
|
116
126
|
sections: CanvasSection[];
|
|
117
127
|
}>;
|
|
128
|
+
/**
|
|
129
|
+
* Get (or create) the shared link for a canvas.
|
|
130
|
+
*
|
|
131
|
+
* `brand_id` (PIT-7682, optional) names an entry in the instance's `shared_link_brands` setting and
|
|
132
|
+
* only takes effect when the link is created. Omit it and the server uses the brand the rep last
|
|
133
|
+
* used on that instance, falling back to the instance default — the behaviour quick-share,
|
|
134
|
+
* bulk-share and API-created links get. A host that does not forward it (the iOS bridge today)
|
|
135
|
+
* therefore still produces a correctly branded link, just without the rep's per-share choice.
|
|
136
|
+
*/
|
|
118
137
|
export declare function shareCanvas(payload: {
|
|
119
138
|
id: CanvasRetrieve['id'];
|
|
139
|
+
brand_id?: string;
|
|
120
140
|
}): Promise<SharedLink>;
|
|
121
141
|
export declare function getCanvasRecommendedFiles(payload: {
|
|
122
142
|
canvas_id: CanvasRetrieve['id'];
|
|
@@ -58,6 +58,13 @@ export declare const UI_MESSAGE_TYPES: {
|
|
|
58
58
|
export declare const UI_NATIVE_MESSAGE_TYPES: readonly ["ui_app_set_data", "ui_app_update_data", "ui_canvas_updated"];
|
|
59
59
|
export type UiBroadcastRequest = Record<string, any>;
|
|
60
60
|
export type UiSelectContentRequest = {
|
|
61
|
+
/**
|
|
62
|
+
* Named sub-embedding of the content selector, forwarded verbatim to the selector app's
|
|
63
|
+
* `window.initialize` payload so ONE selector app can present itself differently per
|
|
64
|
+
* caller (PIT-7510: `ng-wizard` for the pitchdeck wizard). `embed_location` itself is set
|
|
65
|
+
* by the HOST and always wins, so a caller-specific context needs its own field.
|
|
66
|
+
*/
|
|
67
|
+
embed_variant?: string;
|
|
61
68
|
/** Array of selections */
|
|
62
69
|
selections?: Selection[];
|
|
63
70
|
content_type?: 'file' | 'slide' | 'content';
|
|
@@ -349,5 +356,23 @@ export interface UiOpenSharingSettingsResponse {
|
|
|
349
356
|
allowed_domains?: string[];
|
|
350
357
|
valid_until_days?: number | null;
|
|
351
358
|
allow_download?: boolean;
|
|
359
|
+
/**
|
|
360
|
+
* PIT-7682 — id of an entry in the instance's `shared_link_brands` setting, present only when
|
|
361
|
+
* the rep made a deliberate pick in the sharing modal. The host collects it; the app that
|
|
362
|
+
* later creates the link (ng-emails-app's ShareBox POST) forwards it verbatim to
|
|
363
|
+
* `/shared-links`, which is the only place it means anything — the brand is baked into the
|
|
364
|
+
* short URL at creation. Absent means "no choice", and the API applies the brand the rep last
|
|
365
|
+
* used on the instance, then the instance default.
|
|
366
|
+
*/
|
|
367
|
+
brand_id?: string;
|
|
352
368
|
};
|
|
369
|
+
/**
|
|
370
|
+
* PIT-5865 — the name the rep typed for the ShareBox in the sharing modal, already resolved
|
|
371
|
+
* (blank fell back to the default timestamp name, and it is capped at 100 chars). Deliberately a
|
|
372
|
+
* SIBLING of `settings` rather than a field inside it: `settings` is stored verbatim by the
|
|
373
|
+
* calling app as its pending-ShareBox sharing settings and rides into saved drafts, so a canvas
|
|
374
|
+
* name has no business in there. Absent on older hosts — the caller falls back to its own
|
|
375
|
+
* default.
|
|
376
|
+
*/
|
|
377
|
+
canvas_name?: string;
|
|
353
378
|
}
|
package/lib/sdk/interfaces.d.ts
CHANGED
|
@@ -49,7 +49,18 @@ export interface OrgConfigResponse {
|
|
|
49
49
|
sentry_region: 'us' | 'eu';
|
|
50
50
|
}
|
|
51
51
|
export interface PitcherEnv {
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
|
+
* The HOST the web layer is running inside — `mode` IS the platform, one value per OS.
|
|
54
|
+
*
|
|
55
|
+
* `WEB` is the browser; everything else is a NATIVE shell with a JS bridge and an offline
|
|
56
|
+
* mirror (`IOS` the iPad, `MACOS`/`WINDOWS`/`ANDROID` the Tauri desktop/Android shell). Never
|
|
57
|
+
* write `mode === 'IOS'` to mean "native" — use `isNativeHost(mode)` (`@sdk/platform`), which
|
|
58
|
+
* is `mode !== 'WEB'` so a host newer than this bundle still takes the native branch. Values are
|
|
59
|
+
* only ever ADDED to this union — never renamed or removed, apps in the field compare them. `IOS` stays
|
|
60
|
+
* the right test only for iPad HARDWARE: MultipeerConnectivity (peer session), the Salesforce
|
|
61
|
+
* Mobile SDK's SmartStore, on-device inference — subsystems no other host has.
|
|
62
|
+
*/
|
|
63
|
+
mode: 'WEB' | 'IOS' | 'WINDOWS' | 'ANDROID' | 'MACOS';
|
|
53
64
|
pitcher: {
|
|
54
65
|
token_claims: Record<string, any>;
|
|
55
66
|
organization: PitcherOrg;
|
|
@@ -78,6 +89,25 @@ export interface PitcherEnv {
|
|
|
78
89
|
ui_locale?: string;
|
|
79
90
|
device_locale?: string;
|
|
80
91
|
sync_badge_value?: number;
|
|
92
|
+
/**
|
|
93
|
+
* Bridge capabilities the running native host advertises (PIT-7682). Only web posts to the API
|
|
94
|
+
* directly and needs no capability check — every NATIVE host (`isNativeHost(env.mode)`) routes
|
|
95
|
+
* requests through its own bridge handlers.
|
|
96
|
+
*
|
|
97
|
+
* That includes the **Tauri desktop/Android shell** (`pitcher-impact-tauri-ng`), which reports
|
|
98
|
+
* its own build target as `mode` (`MACOS` / `WINDOWS` / `ANDROID`) and states what it supports
|
|
99
|
+
* here. A host that omits a token behaves exactly like an old iPad build — consumers that treat
|
|
100
|
+
* absent as unsupported degrade it safely — so gaining a capability means implementing the
|
|
101
|
+
* forwarding first.
|
|
102
|
+
*
|
|
103
|
+
* Tokens are `<request_type>.<field>`, e.g. `share_canvas.brand_id`. Feature-detect on them
|
|
104
|
+
* rather than on `version`: an older host omits the key entirely, so **absent must be treated as
|
|
105
|
+
* unsupported**. The shape is not guaranteed either — it crosses a bridge from native code — so
|
|
106
|
+
* check `Array.isArray` before `.includes`, or a string value substring-matches the gate open.
|
|
107
|
+
* Defined natively in `BridgeCapabilities` (pitcher-impact-ios-ng); the strings are a permanent
|
|
108
|
+
* contract because web builds in the wild keep checking them.
|
|
109
|
+
*/
|
|
110
|
+
capabilities?: string[];
|
|
81
111
|
}
|
|
82
112
|
export interface PitcherAPI extends Emitter<ApiEventMap> {
|
|
83
113
|
request(type: string, body: any, callback: () => any): Promise<PitcherResponse>;
|
package/lib/sdk/main.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ApiOptions } from './interfaces';
|
|
2
2
|
import { createHighLevelApi } from './api/HighLevelApi';
|
|
3
3
|
export * from './interfaces';
|
|
4
|
+
export * from './platform';
|
|
4
5
|
export * from './payload.types';
|
|
5
6
|
export * from './api/modules/ui/types.ui';
|
|
6
7
|
export * from './api/modules/admin/types.admin';
|
|
@@ -9,8 +10,39 @@ export * from './peer-connectivity';
|
|
|
9
10
|
export declare let highLevelApi: ReturnType<typeof createHighLevelApi>;
|
|
10
11
|
/**
|
|
11
12
|
* Check out the returned object documentation for the list of available methods.
|
|
13
|
+
*
|
|
14
|
+
* `options` CONFIGURES THE SHARED SINGLETON — it is not component-scoped. The
|
|
15
|
+
* host app is expected to pass them exactly once at boot (slotty does this in
|
|
16
|
+
* `api/client.ts`, supplying the Sentry `errorLogger` and the org's `fetchMode`).
|
|
17
|
+
*
|
|
18
|
+
* A call with NO options is a plain accessor and must never rebuild: canvas-ui
|
|
19
|
+
* has ~40 bare `usePitcherApi()` call sites (composables, comment components,
|
|
20
|
+
* `useBroadcastRouteChange` on every sidebar navigation). Rebuilding on those
|
|
21
|
+
* reset the singleton to `LowLevelApi`'s constructor defaults — dropping the
|
|
22
|
+
* host's `fetchMode` back to 'postmessage' and silently replacing the Sentry
|
|
23
|
+
* errorLogger with a no-op for the rest of the session. Because `highLevelApi`
|
|
24
|
+
* is an exported `let` with ESM live binding, every later importer picked up the
|
|
25
|
+
* downgraded instance. Each rebuild also registered another never-removed
|
|
26
|
+
* `window` 'message' listener and fired another `subscribe`, so listeners grew
|
|
27
|
+
* without bound.
|
|
28
|
+
*
|
|
29
|
+
* If you need different options for one call site, use `createScopedPitcherApi`
|
|
30
|
+
* — do not pass options here.
|
|
12
31
|
*/
|
|
13
32
|
export declare function usePitcherApi(options?: ApiOptions): ReturnType<typeof createHighLevelApi>;
|
|
33
|
+
/**
|
|
34
|
+
* A DEDICATED api instance for a call site that needs different options, without
|
|
35
|
+
* touching the shared singleton every other consumer holds.
|
|
36
|
+
*
|
|
37
|
+
* Inherits whatever the host configured (so the Sentry errorLogger and casing
|
|
38
|
+
* survive) and applies `options` on top.
|
|
39
|
+
*
|
|
40
|
+
* Each instance registers its own `window` 'message' listener and its own
|
|
41
|
+
* `subscribe`, so create ONE per call site at module scope — never inside a
|
|
42
|
+
* component `setup()`, which would leak a listener per mount. Responses are
|
|
43
|
+
* matched by callback id and unknown ids are ignored, so instances coexist.
|
|
44
|
+
*/
|
|
45
|
+
export declare function createScopedPitcherApi(options?: ApiOptions): ReturnType<typeof createHighLevelApi>;
|
|
14
46
|
/**
|
|
15
47
|
* API methods available in the CatalogIQ default UI.
|
|
16
48
|
*
|
|
@@ -195,9 +227,11 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
195
227
|
broadcastToWebviews: (event: import('./interfaces').PitcherEvent) => Promise<any>;
|
|
196
228
|
subscribe: () => Promise<any>;
|
|
197
229
|
unsubscribe: () => Promise<any>;
|
|
230
|
+
postJsonWithTimeout<T>(url: string, body: unknown, accessToken: string, timeoutMs: number, label: string): Promise<T>;
|
|
198
231
|
aiGetCapabilities(): Promise<import('./payload.types').AIRuntimeCapabilities>;
|
|
199
232
|
aiComplete(payload: import('./payload.types').AICompletePayload): Promise<import('./payload.types').AICompleteResult>;
|
|
200
233
|
piaSearchAnswer(payload: import('./payload.types').PiaSearchAnswerPayload): Promise<import('./payload.types').PiaSearchAnswerResult>;
|
|
234
|
+
weeklyFocusRank(payload: import('./payload.types').WeeklyFocusRankPayload): Promise<import('./payload.types').WeeklyFocusRankResult>;
|
|
201
235
|
appsDbGetEntries(payload: import('./payload.types').AppsDbGetEntriesPayload): Promise<import('./payload.types').AppsDbEntriesResult>;
|
|
202
236
|
appsDbUpsertEntry(payload: import('./payload.types').AppsDbUpsertEntryPayload): Promise<import('./payload.types').AppsDbEntry>;
|
|
203
237
|
appsDbDeleteEntry(payload: import('./payload.types').AppsDbDeleteEntryPayload): Promise<void>;
|
|
@@ -221,6 +255,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
221
255
|
id: import('../main.lib').CanvasRetrieve["id"];
|
|
222
256
|
instance_id?: import('../main.lib').Instance["id"];
|
|
223
257
|
fields?: string;
|
|
258
|
+
lazy_sections?: boolean;
|
|
224
259
|
}): Promise<import('../main.lib').CanvasRetrieve>;
|
|
225
260
|
updateCanvasIndicators(payload: {
|
|
226
261
|
indicators: Record<string, import('../main.lib').CanvasIndicator>;
|
|
@@ -231,6 +266,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
231
266
|
id: import('../main.lib').CanvasRetrieve["id"];
|
|
232
267
|
fields?: string;
|
|
233
268
|
lazy_sections?: boolean;
|
|
269
|
+
skip_error_toast?: boolean;
|
|
234
270
|
}): Promise<import('../main.lib').CanvasRetrieve>;
|
|
235
271
|
getSectionsByIds(payload: {
|
|
236
272
|
canvas_id: import('../main.lib').CanvasRetrieve["id"];
|
|
@@ -243,6 +279,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
243
279
|
}>;
|
|
244
280
|
shareCanvas(payload: {
|
|
245
281
|
id: import('../main.lib').CanvasRetrieve["id"];
|
|
282
|
+
brand_id?: string;
|
|
246
283
|
}): Promise<import('../main.lib').SharedLink>;
|
|
247
284
|
getCanvasRecommendedFiles(payload: {
|
|
248
285
|
canvas_id: import('../main.lib').CanvasRetrieve["id"];
|
|
@@ -499,9 +536,11 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
499
536
|
broadcastToWebviews: (event: import('./interfaces').PitcherEvent) => Promise<any>;
|
|
500
537
|
subscribe: () => Promise<any>;
|
|
501
538
|
unsubscribe: () => Promise<any>;
|
|
539
|
+
postJsonWithTimeout<T>(url: string, body: unknown, accessToken: string, timeoutMs: number, label: string): Promise<T>;
|
|
502
540
|
aiGetCapabilities(): Promise<import('./payload.types').AIRuntimeCapabilities>;
|
|
503
541
|
aiComplete(payload: import('./payload.types').AICompletePayload): Promise<import('./payload.types').AICompleteResult>;
|
|
504
542
|
piaSearchAnswer(payload: import('./payload.types').PiaSearchAnswerPayload): Promise<import('./payload.types').PiaSearchAnswerResult>;
|
|
543
|
+
weeklyFocusRank(payload: import('./payload.types').WeeklyFocusRankPayload): Promise<import('./payload.types').WeeklyFocusRankResult>;
|
|
505
544
|
appsDbGetEntries(payload: import('./payload.types').AppsDbGetEntriesPayload): Promise<import('./payload.types').AppsDbEntriesResult>;
|
|
506
545
|
appsDbUpsertEntry(payload: import('./payload.types').AppsDbUpsertEntryPayload): Promise<import('./payload.types').AppsDbEntry>;
|
|
507
546
|
appsDbDeleteEntry(payload: import('./payload.types').AppsDbDeleteEntryPayload): Promise<void>;
|
|
@@ -525,6 +564,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
525
564
|
id: import('../main.lib').CanvasRetrieve["id"];
|
|
526
565
|
instance_id?: import('../main.lib').Instance["id"];
|
|
527
566
|
fields?: string;
|
|
567
|
+
lazy_sections?: boolean;
|
|
528
568
|
}): Promise<import('../main.lib').CanvasRetrieve>;
|
|
529
569
|
updateCanvasIndicators(payload: {
|
|
530
570
|
indicators: Record<string, import('../main.lib').CanvasIndicator>;
|
|
@@ -535,6 +575,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
535
575
|
id: import('../main.lib').CanvasRetrieve["id"];
|
|
536
576
|
fields?: string;
|
|
537
577
|
lazy_sections?: boolean;
|
|
578
|
+
skip_error_toast?: boolean;
|
|
538
579
|
}): Promise<import('../main.lib').CanvasRetrieve>;
|
|
539
580
|
getSectionsByIds(payload: {
|
|
540
581
|
canvas_id: import('../main.lib').CanvasRetrieve["id"];
|
|
@@ -547,6 +588,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
547
588
|
}>;
|
|
548
589
|
shareCanvas(payload: {
|
|
549
590
|
id: import('../main.lib').CanvasRetrieve["id"];
|
|
591
|
+
brand_id?: string;
|
|
550
592
|
}): Promise<import('../main.lib').SharedLink>;
|
|
551
593
|
getCanvasRecommendedFiles(payload: {
|
|
552
594
|
canvas_id: import('../main.lib').CanvasRetrieve["id"];
|
|
@@ -749,9 +791,11 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
749
791
|
broadcastToWebviews: (event: import('./interfaces').PitcherEvent) => Promise<any>;
|
|
750
792
|
subscribe: () => Promise<any>;
|
|
751
793
|
unsubscribe: () => Promise<any>;
|
|
794
|
+
postJsonWithTimeout<T>(url: string, body: unknown, accessToken: string, timeoutMs: number, label: string): Promise<T>;
|
|
752
795
|
aiGetCapabilities(): Promise<import('./payload.types').AIRuntimeCapabilities>;
|
|
753
796
|
aiComplete(payload: import('./payload.types').AICompletePayload): Promise<import('./payload.types').AICompleteResult>;
|
|
754
797
|
piaSearchAnswer(payload: import('./payload.types').PiaSearchAnswerPayload): Promise<import('./payload.types').PiaSearchAnswerResult>;
|
|
798
|
+
weeklyFocusRank(payload: import('./payload.types').WeeklyFocusRankPayload): Promise<import('./payload.types').WeeklyFocusRankResult>;
|
|
755
799
|
appsDbGetEntries(payload: import('./payload.types').AppsDbGetEntriesPayload): Promise<import('./payload.types').AppsDbEntriesResult>;
|
|
756
800
|
appsDbUpsertEntry(payload: import('./payload.types').AppsDbUpsertEntryPayload): Promise<import('./payload.types').AppsDbEntry>;
|
|
757
801
|
appsDbDeleteEntry(payload: import('./payload.types').AppsDbDeleteEntryPayload): Promise<void>;
|
|
@@ -779,6 +823,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
779
823
|
id: import('../main.lib').CanvasRetrieve["id"];
|
|
780
824
|
fields?: string;
|
|
781
825
|
lazy_sections?: boolean;
|
|
826
|
+
skip_error_toast?: boolean;
|
|
782
827
|
}): Promise<import('../main.lib').CanvasRetrieve>;
|
|
783
828
|
getSectionsByIds(payload: {
|
|
784
829
|
canvas_id: import('../main.lib').CanvasRetrieve["id"];
|
|
@@ -791,6 +836,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
791
836
|
}>;
|
|
792
837
|
shareCanvas(payload: {
|
|
793
838
|
id: import('../main.lib').CanvasRetrieve["id"];
|
|
839
|
+
brand_id?: string;
|
|
794
840
|
}): Promise<import('../main.lib').SharedLink>;
|
|
795
841
|
getCanvasRecommendedFiles(payload: {
|
|
796
842
|
canvas_id: import('../main.lib').CanvasRetrieve["id"];
|