@nivaro/sdk 0.1.16 → 0.1.18
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/README.md +93 -0
- package/bin/lib/ext-scaffold.mjs +220 -0
- package/bin/lib/graphql-codegen.mjs +737 -0
- package/bin/nivaro.mjs +150 -29
- package/dist/index.d.ts +290 -1
- package/dist/index.js +126 -0
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -1372,6 +1372,80 @@ function fileTransformPath(id, options = {}) {
|
|
|
1372
1372
|
return `/api/files/${id}/transform${qs ? `?${qs}` : ""}`;
|
|
1373
1373
|
}
|
|
1374
1374
|
|
|
1375
|
+
// src/commands/help-videos.ts
|
|
1376
|
+
function listHelpVideos(params) {
|
|
1377
|
+
return cmd("GET", "/help-videos", params);
|
|
1378
|
+
}
|
|
1379
|
+
function readHelpVideo(id) {
|
|
1380
|
+
return cmd("GET", `/help-videos/${id}`);
|
|
1381
|
+
}
|
|
1382
|
+
function helpVideosFor(params) {
|
|
1383
|
+
return cmd("GET", "/help-videos/for", params);
|
|
1384
|
+
}
|
|
1385
|
+
function createHelpVideo(body) {
|
|
1386
|
+
return cmd("POST", "/help-videos", void 0, body);
|
|
1387
|
+
}
|
|
1388
|
+
function updateHelpVideo(id, body) {
|
|
1389
|
+
return cmd("PATCH", `/help-videos/${id}`, void 0, body);
|
|
1390
|
+
}
|
|
1391
|
+
function setHelpVideoContexts(id, contexts) {
|
|
1392
|
+
return cmd("PUT", `/help-videos/${id}/contexts`, void 0, { contexts });
|
|
1393
|
+
}
|
|
1394
|
+
function setHelpVideoRequirements(id, role_ids) {
|
|
1395
|
+
return cmd("PUT", `/help-videos/${id}/requirements`, void 0, { role_ids });
|
|
1396
|
+
}
|
|
1397
|
+
function archiveHelpVideo(id, opts) {
|
|
1398
|
+
return cmd("DELETE", `/help-videos/${id}`, opts?.purge ? { purge: 1 } : void 0);
|
|
1399
|
+
}
|
|
1400
|
+
function readHelpVideoDraft(id) {
|
|
1401
|
+
return cmd("GET", `/help-videos/${id}/draft/edits`);
|
|
1402
|
+
}
|
|
1403
|
+
function saveHelpVideoDraft(id, edits, base_hash) {
|
|
1404
|
+
return cmd("PUT", `/help-videos/${id}/draft/edits`, void 0, { edits, base_hash });
|
|
1405
|
+
}
|
|
1406
|
+
function publishHelpVideo(id, opts) {
|
|
1407
|
+
return cmd("POST", `/help-videos/${id}/publish`, void 0, opts ?? {});
|
|
1408
|
+
}
|
|
1409
|
+
function rerecordHelpVideo(id, upload_id) {
|
|
1410
|
+
return cmd("POST", `/help-videos/${id}/rerecord`, void 0, { upload_id });
|
|
1411
|
+
}
|
|
1412
|
+
function listHelpVideoVersions(id) {
|
|
1413
|
+
return cmd("GET", `/help-videos/${id}/versions`);
|
|
1414
|
+
}
|
|
1415
|
+
function restoreHelpVideoVersion(id, versionId) {
|
|
1416
|
+
return cmd("POST", `/help-videos/${id}/versions/${versionId}/restore`);
|
|
1417
|
+
}
|
|
1418
|
+
function rerenderHelpVideo(id, opts) {
|
|
1419
|
+
return cmd("POST", `/help-videos/${id}/render`, opts?.draft ? { draft: 1 } : void 0);
|
|
1420
|
+
}
|
|
1421
|
+
function recordHelpVideoProgress(id, body) {
|
|
1422
|
+
return cmd("POST", `/help-videos/${id}/progress`, void 0, body);
|
|
1423
|
+
}
|
|
1424
|
+
function readRequiredHelpVideos() {
|
|
1425
|
+
return cmd("GET", "/help-videos/required/mine");
|
|
1426
|
+
}
|
|
1427
|
+
function readHelpVideoAnalytics(id) {
|
|
1428
|
+
return cmd("GET", `/help-videos/${id}/analytics`);
|
|
1429
|
+
}
|
|
1430
|
+
function openHelpVideoUpload(mime) {
|
|
1431
|
+
return cmd("POST", "/help-videos/uploads", void 0, { mime });
|
|
1432
|
+
}
|
|
1433
|
+
function finalizeHelpVideoUpload(id, meta) {
|
|
1434
|
+
return cmd("POST", `/help-videos/uploads/${id}/finalize`, void 0, meta ?? {});
|
|
1435
|
+
}
|
|
1436
|
+
function listMyHelpVideoUploads() {
|
|
1437
|
+
return cmd("GET", "/help-videos/uploads/mine");
|
|
1438
|
+
}
|
|
1439
|
+
function abandonHelpVideoUpload(id) {
|
|
1440
|
+
return cmd("DELETE", `/help-videos/uploads/${id}`);
|
|
1441
|
+
}
|
|
1442
|
+
function listHelpVideoPages() {
|
|
1443
|
+
return cmd("GET", "/help-videos/pages");
|
|
1444
|
+
}
|
|
1445
|
+
function registerHelpVideoPage(body) {
|
|
1446
|
+
return cmd("POST", "/help-videos/pages", void 0, body);
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1375
1449
|
// src/commands/import-templates.ts
|
|
1376
1450
|
var listImportTemplates = (collection) => cmd("GET", "/import-templates", { collection });
|
|
1377
1451
|
var executeImportTemplate = (id, payload) => cmd("POST", `/import-templates/${id}/execute`, void 0, payload);
|
|
@@ -1820,6 +1894,32 @@ function aggregateItems(collection, query) {
|
|
|
1820
1894
|
function readItem(collection, id) {
|
|
1821
1895
|
return cmd("GET", `/items/${collection}/${id}`);
|
|
1822
1896
|
}
|
|
1897
|
+
var READ_MANY_MAX = 20;
|
|
1898
|
+
function readMany(reads) {
|
|
1899
|
+
return cmd("POST", "/items/batch-read", void 0, {
|
|
1900
|
+
reads: reads.map((r) => ({
|
|
1901
|
+
...r.key != null ? { key: r.key } : {},
|
|
1902
|
+
collection: r.collection,
|
|
1903
|
+
...r.id != null ? { id: r.id } : {},
|
|
1904
|
+
...r.query ? { query: batchReadQuery(r.query, r.id == null) } : {}
|
|
1905
|
+
}))
|
|
1906
|
+
});
|
|
1907
|
+
}
|
|
1908
|
+
function batchReadQuery(query, list) {
|
|
1909
|
+
const q = {};
|
|
1910
|
+
if (query.fields?.length) q.fields = query.fields.join(",");
|
|
1911
|
+
if (!list) return q;
|
|
1912
|
+
if (query.filter) q.filter = query.filter;
|
|
1913
|
+
if (query.sort?.length) q.sort = query.sort.join(",");
|
|
1914
|
+
if (query.limit != null) q.limit = query.limit;
|
|
1915
|
+
if (query.offset != null) q.offset = query.offset;
|
|
1916
|
+
if (query.page != null) q.page = query.page;
|
|
1917
|
+
if (query.search) q.search = query.search;
|
|
1918
|
+
if (query.after != null) q.after = query.after;
|
|
1919
|
+
if (query.count === false) q.count = 0;
|
|
1920
|
+
if (query.conditions?.length) q.conditions = query.conditions;
|
|
1921
|
+
return q;
|
|
1922
|
+
}
|
|
1823
1923
|
function createItem(collection, data) {
|
|
1824
1924
|
return cmd("POST", `/items/${collection}`, void 0, data);
|
|
1825
1925
|
}
|
|
@@ -2528,6 +2628,7 @@ function submitFormItem(collection, values, options) {
|
|
|
2528
2628
|
return cmd("POST", `/items/${collection}`, void 0, values);
|
|
2529
2629
|
}
|
|
2530
2630
|
export {
|
|
2631
|
+
READ_MANY_MAX,
|
|
2531
2632
|
_and,
|
|
2532
2633
|
_contains,
|
|
2533
2634
|
_ends_with,
|
|
@@ -2546,6 +2647,7 @@ export {
|
|
|
2546
2647
|
_or,
|
|
2547
2648
|
_some,
|
|
2548
2649
|
_starts_with,
|
|
2650
|
+
abandonHelpVideoUpload,
|
|
2549
2651
|
acquireItemLock,
|
|
2550
2652
|
activateLayout,
|
|
2551
2653
|
addChatChannelMember,
|
|
@@ -2569,6 +2671,7 @@ export {
|
|
|
2569
2671
|
applySubRowTemplate,
|
|
2570
2672
|
approveAddendum,
|
|
2571
2673
|
approveAiProposal,
|
|
2674
|
+
archiveHelpVideo,
|
|
2572
2675
|
asc,
|
|
2573
2676
|
backupExportPath,
|
|
2574
2677
|
batchPickerExclusionStatus,
|
|
@@ -2608,6 +2711,7 @@ export {
|
|
|
2608
2711
|
createFieldGroup,
|
|
2609
2712
|
createFieldWatch,
|
|
2610
2713
|
createGroupDm,
|
|
2714
|
+
createHelpVideo,
|
|
2611
2715
|
createHierarchyConfig,
|
|
2612
2716
|
createImportDefinition,
|
|
2613
2717
|
createImportJob,
|
|
@@ -2746,6 +2850,7 @@ export {
|
|
|
2746
2850
|
fetchFormSchema,
|
|
2747
2851
|
fileDownloadPath,
|
|
2748
2852
|
fileTransformPath,
|
|
2853
|
+
finalizeHelpVideoUpload,
|
|
2749
2854
|
generateToken,
|
|
2750
2855
|
generateUserToken,
|
|
2751
2856
|
getAlertDefinition,
|
|
@@ -2768,6 +2873,7 @@ export {
|
|
|
2768
2873
|
getWebhook,
|
|
2769
2874
|
globalSearch,
|
|
2770
2875
|
heartbeatItemLock,
|
|
2876
|
+
helpVideosFor,
|
|
2771
2877
|
importExternalApiSpec,
|
|
2772
2878
|
importSchemaSnapshot,
|
|
2773
2879
|
includeInPicker,
|
|
@@ -2816,6 +2922,9 @@ export {
|
|
|
2816
2922
|
listFieldWatches,
|
|
2817
2923
|
listFiles,
|
|
2818
2924
|
listFlowRuns,
|
|
2925
|
+
listHelpVideoPages,
|
|
2926
|
+
listHelpVideoVersions,
|
|
2927
|
+
listHelpVideos,
|
|
2819
2928
|
listHierarchyConfigs,
|
|
2820
2929
|
listImportDefinitionVersions,
|
|
2821
2930
|
listImportDefinitions,
|
|
@@ -2829,6 +2938,7 @@ export {
|
|
|
2829
2938
|
listMetricAlertRules,
|
|
2830
2939
|
listMetricAlertSubscriptions,
|
|
2831
2940
|
listMetricDefinitions,
|
|
2941
|
+
listMyHelpVideoUploads,
|
|
2832
2942
|
listMyTasks,
|
|
2833
2943
|
listNotificationSubscriptions,
|
|
2834
2944
|
listNotifications,
|
|
@@ -2891,10 +3001,12 @@ export {
|
|
|
2891
3001
|
moveTreeNode,
|
|
2892
3002
|
nudgeTask,
|
|
2893
3003
|
omniSearch,
|
|
3004
|
+
openHelpVideoUpload,
|
|
2894
3005
|
presignFileUpload,
|
|
2895
3006
|
previewContentBundle,
|
|
2896
3007
|
previewImportJob,
|
|
2897
3008
|
previewReportWidget,
|
|
3009
|
+
publishHelpVideo,
|
|
2898
3010
|
publishItem,
|
|
2899
3011
|
queryVirtualCollection,
|
|
2900
3012
|
readAccessAuditFindings,
|
|
@@ -2936,6 +3048,9 @@ export {
|
|
|
2936
3048
|
readFieldWatch,
|
|
2937
3049
|
readFileMeta,
|
|
2938
3050
|
readFileUsage,
|
|
3051
|
+
readHelpVideo,
|
|
3052
|
+
readHelpVideoAnalytics,
|
|
3053
|
+
readHelpVideoDraft,
|
|
2939
3054
|
readHierarchyConfig,
|
|
2940
3055
|
readHierarchyNodeAncestors,
|
|
2941
3056
|
readHierarchyNodeChildren,
|
|
@@ -2955,6 +3070,7 @@ export {
|
|
|
2955
3070
|
readLastTouch,
|
|
2956
3071
|
readLayoutAssignments,
|
|
2957
3072
|
readLayoutGroups,
|
|
3073
|
+
readMany,
|
|
2958
3074
|
readMe,
|
|
2959
3075
|
readMetricAlertLog,
|
|
2960
3076
|
readMyScopes,
|
|
@@ -2990,6 +3106,7 @@ export {
|
|
|
2990
3106
|
readReportSubscription,
|
|
2991
3107
|
readReportUsage,
|
|
2992
3108
|
readReportWidgetData,
|
|
3109
|
+
readRequiredHelpVideos,
|
|
2993
3110
|
readRevision,
|
|
2994
3111
|
readRevisions,
|
|
2995
3112
|
readRole,
|
|
@@ -3030,6 +3147,8 @@ export {
|
|
|
3030
3147
|
readWorkspace,
|
|
3031
3148
|
readWorkspaceUsage,
|
|
3032
3149
|
rebuildTreePaths,
|
|
3150
|
+
recordHelpVideoProgress,
|
|
3151
|
+
registerHelpVideoPage,
|
|
3033
3152
|
rehearseCreateItem,
|
|
3034
3153
|
reindexSemanticSearch,
|
|
3035
3154
|
rejectAddendum,
|
|
@@ -3050,8 +3169,11 @@ export {
|
|
|
3050
3169
|
reportClientError,
|
|
3051
3170
|
requestRecordAccess,
|
|
3052
3171
|
requeueStagedImport,
|
|
3172
|
+
rerecordHelpVideo,
|
|
3173
|
+
rerenderHelpVideo,
|
|
3053
3174
|
resetReportCache,
|
|
3054
3175
|
resolveReportAlert,
|
|
3176
|
+
restoreHelpVideoVersion,
|
|
3055
3177
|
restoreImportDefinitionVersion,
|
|
3056
3178
|
restoreLayoutVersion,
|
|
3057
3179
|
restorePipelineVersion,
|
|
@@ -3073,6 +3195,7 @@ export {
|
|
|
3073
3195
|
runRetentionPolicy,
|
|
3074
3196
|
runScheduledReport,
|
|
3075
3197
|
runSyncJob,
|
|
3198
|
+
saveHelpVideoDraft,
|
|
3076
3199
|
saveMyScopeDefaults,
|
|
3077
3200
|
saveReportFilterPreset,
|
|
3078
3201
|
saveReportTemplate,
|
|
@@ -3084,6 +3207,8 @@ export {
|
|
|
3084
3207
|
sendChatMessage,
|
|
3085
3208
|
sendTestMail,
|
|
3086
3209
|
sessionRecordingEnabled,
|
|
3210
|
+
setHelpVideoContexts,
|
|
3211
|
+
setHelpVideoRequirements,
|
|
3087
3212
|
setMyDelegate,
|
|
3088
3213
|
setQueueDefaultView,
|
|
3089
3214
|
setReportSubscription,
|
|
@@ -3143,6 +3268,7 @@ export {
|
|
|
3143
3268
|
updateFieldGroup,
|
|
3144
3269
|
updateFieldWatch,
|
|
3145
3270
|
updateFileMeta,
|
|
3271
|
+
updateHelpVideo,
|
|
3146
3272
|
updateHierarchyConfig,
|
|
3147
3273
|
updateImportDefinition,
|
|
3148
3274
|
updateInternalWidget,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nivaro/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "TypeScript SDK for Nivaro CMS — typed REST client, GraphQL, realtime subscriptions, and presence.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"files": [
|
|
19
19
|
"dist",
|
|
20
20
|
"bin",
|
|
21
|
+
"!bin/**/*.test.mjs",
|
|
21
22
|
"README.md"
|
|
22
23
|
],
|
|
23
24
|
"keywords": [
|
|
@@ -48,7 +49,8 @@
|
|
|
48
49
|
},
|
|
49
50
|
"scripts": {
|
|
50
51
|
"build": "tsup src/index.ts --format esm --dts --out-dir dist",
|
|
51
|
-
"dev": "tsup src/index.ts --format esm --dts --out-dir dist --watch"
|
|
52
|
+
"dev": "tsup src/index.ts --format esm --dts --out-dir dist --watch",
|
|
53
|
+
"test": "node --test bin/lib/*.test.mjs"
|
|
52
54
|
},
|
|
53
55
|
"dependencies": {
|
|
54
56
|
"socket.io-client": "^4.8.1"
|