@nodaro/sdk 2.60.1 → 2.62.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/dist/{chunk-Z3ZKFI2M.js → chunk-22XXTB2R.js} +2 -2
- package/dist/chunk-22XXTB2R.js.map +1 -0
- package/dist/{chunk-ALDXFMD7.js → chunk-2ENKGVRS.js} +17 -6
- package/dist/chunk-2ENKGVRS.js.map +1 -0
- package/dist/chunk-2M4VYNSE.cjs +4 -0
- package/dist/chunk-2M4VYNSE.cjs.map +1 -0
- package/dist/chunk-3OARKXWT.cjs +53 -0
- package/dist/chunk-3OARKXWT.cjs.map +1 -0
- package/dist/{chunk-JJMQ2EVL.js → chunk-5AS4LKEF.js} +23 -3
- package/dist/chunk-5AS4LKEF.js.map +1 -0
- package/dist/{chunk-MWSD2FSG.cjs → chunk-5LI4CVJB.cjs} +2 -2
- package/dist/chunk-5LI4CVJB.cjs.map +1 -0
- package/dist/{chunk-GSE7SB3I.cjs → chunk-7GC5LKCR.cjs} +24 -2
- package/dist/chunk-7GC5LKCR.cjs.map +1 -0
- package/dist/{chunk-X24USXOQ.js → chunk-A42R7UT7.js} +2 -2
- package/dist/chunk-A42R7UT7.js.map +1 -0
- package/dist/{chunk-3Y5TDB5K.cjs → chunk-ASPUFRHB.cjs} +11 -7
- package/dist/chunk-ASPUFRHB.cjs.map +1 -0
- package/dist/{chunk-3JJP6BR2.js → chunk-BCZGMK5P.js} +4 -4
- package/dist/{chunk-3JJP6BR2.js.map → chunk-BCZGMK5P.js.map} +1 -1
- package/dist/{chunk-HPAHAE4U.cjs → chunk-DCMB5XOH.cjs} +5 -5
- package/dist/{chunk-HPAHAE4U.cjs.map → chunk-DCMB5XOH.cjs.map} +1 -1
- package/dist/{chunk-RCD4HDBI.js → chunk-DIPHH4OP.js} +3 -3
- package/dist/{chunk-RCD4HDBI.js.map → chunk-DIPHH4OP.js.map} +1 -1
- package/dist/{chunk-GWTKYJJO.cjs → chunk-DODUCQ6B.cjs} +36 -25
- package/dist/chunk-DODUCQ6B.cjs.map +1 -0
- package/dist/{chunk-YYMX3VN7.js → chunk-DT3Q22NZ.js} +3 -3
- package/dist/{chunk-YYMX3VN7.js.map → chunk-DT3Q22NZ.js.map} +1 -1
- package/dist/{chunk-COCKKMNP.cjs → chunk-G4AFHCNA.cjs} +2 -2
- package/dist/chunk-G4AFHCNA.cjs.map +1 -0
- package/dist/{chunk-TVPYDC5T.cjs → chunk-GGIWDFER.cjs} +2 -2
- package/dist/chunk-GGIWDFER.cjs.map +1 -0
- package/dist/{chunk-GDUEOKBF.cjs → chunk-GSKGWWBR.cjs} +4 -4
- package/dist/{chunk-GDUEOKBF.cjs.map → chunk-GSKGWWBR.cjs.map} +1 -1
- package/dist/{chunk-TSM3S2QS.cjs → chunk-IVM4WMMD.cjs} +5 -5
- package/dist/{chunk-TSM3S2QS.cjs.map → chunk-IVM4WMMD.cjs.map} +1 -1
- package/dist/{chunk-K4RQOSJH.js → chunk-J2DBYYXC.js} +2 -2
- package/dist/chunk-J2DBYYXC.js.map +1 -0
- package/dist/{chunk-DOMNKVKA.cjs → chunk-JW5FH4TE.cjs} +9 -9
- package/dist/{chunk-DOMNKVKA.cjs.map → chunk-JW5FH4TE.cjs.map} +1 -1
- package/dist/chunk-K2VWXAGK.js +51 -0
- package/dist/chunk-K2VWXAGK.js.map +1 -0
- package/dist/{chunk-KU3UITCU.cjs → chunk-KCQ3I6NW.cjs} +5 -5
- package/dist/{chunk-KU3UITCU.cjs.map → chunk-KCQ3I6NW.cjs.map} +1 -1
- package/dist/chunk-NMLYZWIW.cjs +4 -0
- package/dist/chunk-NMLYZWIW.cjs.map +1 -0
- package/dist/{chunk-VTL4DBX4.js → chunk-NQXBWK2D.js} +3 -3
- package/dist/{chunk-VTL4DBX4.js.map → chunk-NQXBWK2D.js.map} +1 -1
- package/dist/{chunk-DTYN7QAZ.js → chunk-P2C33IOF.js} +9 -4
- package/dist/chunk-P2C33IOF.js.map +1 -0
- package/dist/chunk-RKW3N463.cjs +83 -0
- package/dist/chunk-RKW3N463.cjs.map +1 -0
- package/dist/{chunk-ND7JMM5H.js → chunk-SEETG3EM.js} +10 -6
- package/dist/chunk-SEETG3EM.js.map +1 -0
- package/dist/{chunk-7DJFJZ35.cjs → chunk-SXV6OBKE.cjs} +41 -33
- package/dist/chunk-SXV6OBKE.cjs.map +1 -0
- package/dist/chunk-TLTPIS2A.js +81 -0
- package/dist/chunk-TLTPIS2A.js.map +1 -0
- package/dist/chunk-UIBY7JVJ.js +3 -0
- package/dist/chunk-UIBY7JVJ.js.map +1 -0
- package/dist/{chunk-NOZWIS7M.cjs → chunk-UPGZTLK7.cjs} +9 -4
- package/dist/chunk-UPGZTLK7.cjs.map +1 -0
- package/dist/{chunk-TO2RA7BF.js → chunk-UR7S4GGS.js} +29 -21
- package/dist/chunk-UR7S4GGS.js.map +1 -0
- package/dist/{chunk-MUHRK4OI.js → chunk-VAEXSUUY.js} +3 -3
- package/dist/{chunk-MUHRK4OI.js.map → chunk-VAEXSUUY.js.map} +1 -1
- package/dist/{chunk-ZVKEPVDQ.js → chunk-VQOUF4F5.js} +2 -2
- package/dist/chunk-VQOUF4F5.js.map +1 -0
- package/dist/{chunk-SBV5MWEL.cjs → chunk-VUTNNRDW.cjs} +2 -2
- package/dist/chunk-VUTNNRDW.cjs.map +1 -0
- package/dist/{chunk-VKE6UEDY.cjs → chunk-WYX44JHE.cjs} +12 -2
- package/dist/chunk-WYX44JHE.cjs.map +1 -0
- package/dist/{chunk-7OUDMUXF.js → chunk-X4QICOOM.js} +12 -2
- package/dist/chunk-X4QICOOM.js.map +1 -0
- package/dist/chunk-XV4MDWHF.js +3 -0
- package/dist/chunk-XV4MDWHF.js.map +1 -0
- package/dist/entries/billing.cjs +2 -2
- package/dist/entries/billing.d.cts +5 -1
- package/dist/entries/billing.d.ts +5 -1
- package/dist/entries/billing.js +1 -1
- package/dist/entries/cast-swap.cjs +2 -2
- package/dist/entries/cast-swap.d.cts +50 -8
- package/dist/entries/cast-swap.d.ts +50 -8
- package/dist/entries/cast-swap.js +1 -1
- package/dist/entries/characters.d.cts +1 -1
- package/dist/entries/characters.d.ts +1 -1
- package/dist/entries/client.cjs +29 -27
- package/dist/entries/client.d.cts +7 -1
- package/dist/entries/client.d.ts +7 -1
- package/dist/entries/client.js +24 -22
- package/dist/entries/content-rights.cjs +13 -0
- package/dist/entries/content-rights.cjs.map +1 -0
- package/dist/entries/content-rights.d.cts +82 -0
- package/dist/entries/content-rights.d.ts +82 -0
- package/dist/entries/content-rights.js +4 -0
- package/dist/entries/content-rights.js.map +1 -0
- package/dist/entries/copilot.cjs +4 -4
- package/dist/entries/copilot.js +3 -3
- package/dist/entries/core.cjs +6 -6
- package/dist/entries/core.js +2 -2
- package/dist/entries/creatures.d.cts +1 -1
- package/dist/entries/creatures.d.ts +1 -1
- package/dist/entries/edit.cjs +7 -7
- package/dist/entries/edit.js +2 -2
- package/dist/entries/errors.cjs +34 -26
- package/dist/entries/errors.d.cts +31 -2
- package/dist/entries/errors.d.ts +31 -2
- package/dist/entries/errors.js +1 -1
- package/dist/entries/executions.cjs +4 -4
- package/dist/entries/executions.d.cts +8 -0
- package/dist/entries/executions.d.ts +8 -0
- package/dist/entries/executions.js +1 -1
- package/dist/entries/jobs.cjs +2 -2
- package/dist/entries/jobs.d.cts +50 -1
- package/dist/entries/jobs.d.ts +50 -1
- package/dist/entries/jobs.js +1 -1
- package/dist/entries/locations.d.cts +1 -1
- package/dist/entries/locations.d.ts +1 -1
- package/dist/entries/media.cjs +4 -4
- package/dist/entries/media.d.cts +8 -3
- package/dist/entries/media.d.ts +8 -3
- package/dist/entries/media.js +3 -3
- package/dist/entries/nodes.cjs +3 -3
- package/dist/entries/nodes.d.cts +1 -1
- package/dist/entries/nodes.d.ts +1 -1
- package/dist/entries/nodes.js +2 -2
- package/dist/entries/objects.d.cts +1 -1
- package/dist/entries/objects.d.ts +1 -1
- package/dist/entries/pipelines.cjs +2 -2
- package/dist/entries/pipelines.d.cts +7 -0
- package/dist/entries/pipelines.d.ts +7 -0
- package/dist/entries/pipelines.js +1 -1
- package/dist/entries/scene3d.d.cts +2 -2
- package/dist/entries/scene3d.d.ts +2 -2
- package/dist/entries/studio.cjs +5 -5
- package/dist/entries/studio.js +2 -2
- package/dist/entries/trend-radar.cjs +13 -0
- package/dist/entries/trend-radar.cjs.map +1 -0
- package/dist/entries/trend-radar.d.cts +243 -0
- package/dist/entries/trend-radar.d.ts +243 -0
- package/dist/entries/trend-radar.js +4 -0
- package/dist/entries/trend-radar.js.map +1 -0
- package/dist/entries/uploads.cjs +2 -2
- package/dist/entries/uploads.d.cts +8 -1
- package/dist/entries/uploads.d.ts +8 -1
- package/dist/entries/uploads.js +1 -1
- package/dist/index.cjs +135 -115
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +33 -29
- package/dist/{nodes-Cy6dmQEz.d.ts → nodes-BXL3qXlY.d.ts} +10 -2
- package/dist/{nodes-Di-Z7-vr.d.cts → nodes-Dx8rpU12.d.cts} +10 -2
- package/package.json +12 -2
- package/dist/chunk-3Y5TDB5K.cjs.map +0 -1
- package/dist/chunk-7DJFJZ35.cjs.map +0 -1
- package/dist/chunk-7OUDMUXF.js.map +0 -1
- package/dist/chunk-ALDXFMD7.js.map +0 -1
- package/dist/chunk-COCKKMNP.cjs.map +0 -1
- package/dist/chunk-DTYN7QAZ.js.map +0 -1
- package/dist/chunk-GSE7SB3I.cjs.map +0 -1
- package/dist/chunk-GWTKYJJO.cjs.map +0 -1
- package/dist/chunk-JJMQ2EVL.js.map +0 -1
- package/dist/chunk-K4RQOSJH.js.map +0 -1
- package/dist/chunk-MWSD2FSG.cjs.map +0 -1
- package/dist/chunk-ND7JMM5H.js.map +0 -1
- package/dist/chunk-NOZWIS7M.cjs.map +0 -1
- package/dist/chunk-SBV5MWEL.cjs.map +0 -1
- package/dist/chunk-TO2RA7BF.js.map +0 -1
- package/dist/chunk-TVPYDC5T.cjs.map +0 -1
- package/dist/chunk-VKE6UEDY.cjs.map +0 -1
- package/dist/chunk-X24USXOQ.js.map +0 -1
- package/dist/chunk-Z3ZKFI2M.js.map +0 -1
- package/dist/chunk-ZVKEPVDQ.js.map +0 -1
package/dist/entries/studio.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../chunk-PMTM26LL.js';
|
|
2
|
-
export { StudioProductionsResource, StudioResource, isStudioGenerateEstimate } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
2
|
+
export { StudioProductionsResource, StudioResource, isStudioGenerateEstimate } from '../chunk-NQXBWK2D.js';
|
|
3
|
+
import '../chunk-5AS4LKEF.js';
|
|
4
4
|
//# sourceMappingURL=studio.js.map
|
|
5
5
|
//# sourceMappingURL=studio.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('../chunk-NMLYZWIW.cjs');
|
|
4
|
+
var chunkRKW3N463_cjs = require('../chunk-RKW3N463.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "TrendRadarResource", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkRKW3N463_cjs.TrendRadarResource; }
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=trend-radar.cjs.map
|
|
13
|
+
//# sourceMappingURL=trend-radar.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"trend-radar.cjs"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { N as NodaroClientCore } from '../developer-apps-CMUzKpE9.cjs';
|
|
2
|
+
import '@nodaro/shared/apps';
|
|
3
|
+
import '@nodaro/shared/organizations';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Trend Radar — the daily run that finds candidate trends (a short clip
|
|
7
|
+
* several different creators recast within a few weeks) on Nodaro Cloud, and
|
|
8
|
+
* the admin's decisions on them. Mirrors `/v1/trend-radar/*`
|
|
9
|
+
* (`backend/src/ee/routes/trend-radar.ts`, shapes in
|
|
10
|
+
* `backend/src/ee/lib/trend-radar/types.ts`): keep the two in step.
|
|
11
|
+
*
|
|
12
|
+
* Every method answers a SIGNED-IN ADMIN SESSION only (`supabaseAuth`, the
|
|
13
|
+
* credential a first-party web app holds): an API key or an app's OAuth
|
|
14
|
+
* token gets `403 forbidden` (`ForbiddenError`), a signed-in non-admin too.
|
|
15
|
+
* A self-hosted instance has no radar (`NotFoundError`); Nodaro Cloud before
|
|
16
|
+
* its storage exists answers `503 not_available`.
|
|
17
|
+
*/
|
|
18
|
+
type TrendCandidateStatus = "watching" | "candidate" | "slowing" | "approved" | "rejected" | "archived";
|
|
19
|
+
type TrendCandidateLabel = "new" | "watching" | "rising" | "hot" | "slowing";
|
|
20
|
+
type TrendCandidateSort = "creators" | "dayChange" | "firstSeen";
|
|
21
|
+
type TrendRadarSourceKind = "sitemap" | "social" | "suggest";
|
|
22
|
+
type TrendCandidatePlatform = "tiktok" | "instagram" | "youtube";
|
|
23
|
+
/** Where a candidate was first seen: a template site's page, or a public post. */
|
|
24
|
+
interface TrendCandidateSource {
|
|
25
|
+
kind: "template-site" | "social";
|
|
26
|
+
name: string;
|
|
27
|
+
url: string | null;
|
|
28
|
+
firstSeenAt: string;
|
|
29
|
+
}
|
|
30
|
+
/** One public post as a link and its public counts. */
|
|
31
|
+
interface TrendCandidatePost {
|
|
32
|
+
platform: TrendCandidatePlatform;
|
|
33
|
+
url: string;
|
|
34
|
+
author: string;
|
|
35
|
+
postedAt: string | null;
|
|
36
|
+
/** `null` where the platform hides views to a logged-out reader (Instagram): read `likes`. */
|
|
37
|
+
plays: number | null;
|
|
38
|
+
likes: number | null;
|
|
39
|
+
soundName: string | null;
|
|
40
|
+
/** The platform's own still, when it gave one; a short-lived link. */
|
|
41
|
+
stillUrl: string | null;
|
|
42
|
+
/** The platform's own player for the post (`<iframe src>`), when it has one. */
|
|
43
|
+
embedUrl: string | null;
|
|
44
|
+
durationSec: number | null;
|
|
45
|
+
}
|
|
46
|
+
/** One day's reading: distinct creators, summed plays, posts returned. */
|
|
47
|
+
interface TrendCandidateReading {
|
|
48
|
+
/** `YYYY-MM-DD`, Israel time. */
|
|
49
|
+
date: string;
|
|
50
|
+
creators: number;
|
|
51
|
+
plays: number;
|
|
52
|
+
posts: number;
|
|
53
|
+
}
|
|
54
|
+
interface TrendCandidateCard {
|
|
55
|
+
id: string;
|
|
56
|
+
name: string;
|
|
57
|
+
slug: string;
|
|
58
|
+
status: TrendCandidateStatus;
|
|
59
|
+
label: TrendCandidateLabel;
|
|
60
|
+
soundName: string | null;
|
|
61
|
+
durationSec: number | null;
|
|
62
|
+
creators: number;
|
|
63
|
+
plays: number;
|
|
64
|
+
/** Plays growth from the previous reading, percent; `null` before two readings. */
|
|
65
|
+
dayChangePct: number | null;
|
|
66
|
+
firstSeen: TrendCandidateSource;
|
|
67
|
+
topPost: TrendCandidatePost | null;
|
|
68
|
+
/** When the candidate first reached the creator threshold. */
|
|
69
|
+
passedAt: string | null;
|
|
70
|
+
/** The draft trend an approval created. */
|
|
71
|
+
trendId: string | null;
|
|
72
|
+
createdAt: string;
|
|
73
|
+
updatedAt: string;
|
|
74
|
+
}
|
|
75
|
+
interface TrendCandidateTemplate {
|
|
76
|
+
site: string;
|
|
77
|
+
url: string;
|
|
78
|
+
since: string | null;
|
|
79
|
+
note: string | null;
|
|
80
|
+
}
|
|
81
|
+
interface TrendCandidateSearch {
|
|
82
|
+
/** Whether the search engine suggests "<name> ai"; `null` when not checked. */
|
|
83
|
+
suggest: boolean | null;
|
|
84
|
+
interest7d: {
|
|
85
|
+
from: number;
|
|
86
|
+
to: number;
|
|
87
|
+
} | null;
|
|
88
|
+
checkedAt: string;
|
|
89
|
+
}
|
|
90
|
+
interface TrendCandidateEvent {
|
|
91
|
+
at: string;
|
|
92
|
+
event: string;
|
|
93
|
+
detail: string | null;
|
|
94
|
+
}
|
|
95
|
+
/** A threshold the candidate is held to; `auto` is whether the last reading met it (`null`: not read yet). */
|
|
96
|
+
interface TrendCandidateCheck {
|
|
97
|
+
key: string;
|
|
98
|
+
label: string;
|
|
99
|
+
hint: string | null;
|
|
100
|
+
auto: boolean | null;
|
|
101
|
+
}
|
|
102
|
+
interface TrendCandidate extends TrendCandidateCard {
|
|
103
|
+
summary: string | null;
|
|
104
|
+
posts: TrendCandidatePost[];
|
|
105
|
+
/** Oldest first. */
|
|
106
|
+
readings: TrendCandidateReading[];
|
|
107
|
+
templatesElsewhere: TrendCandidateTemplate[];
|
|
108
|
+
search: TrendCandidateSearch | null;
|
|
109
|
+
/** Oldest first. */
|
|
110
|
+
history: TrendCandidateEvent[];
|
|
111
|
+
checklist: TrendCandidateCheck[];
|
|
112
|
+
rejectReason: string | null;
|
|
113
|
+
}
|
|
114
|
+
interface TrendRadarSource {
|
|
115
|
+
id: string;
|
|
116
|
+
name: string;
|
|
117
|
+
kind: TrendRadarSourceKind;
|
|
118
|
+
url: string | null;
|
|
119
|
+
enabled: boolean;
|
|
120
|
+
lastReadAt: string | null;
|
|
121
|
+
pages: number | null;
|
|
122
|
+
newToday: number | null;
|
|
123
|
+
lastError: string | null;
|
|
124
|
+
}
|
|
125
|
+
interface TrendRadarThresholds {
|
|
126
|
+
minCreators: number;
|
|
127
|
+
windowDays: number;
|
|
128
|
+
risingPct: number;
|
|
129
|
+
slowingPct: number;
|
|
130
|
+
maxClipSec: number;
|
|
131
|
+
dailySearchBudget: number;
|
|
132
|
+
}
|
|
133
|
+
interface TrendRadarAlerts {
|
|
134
|
+
slackNewCandidate: boolean;
|
|
135
|
+
slackDailySummary: boolean;
|
|
136
|
+
}
|
|
137
|
+
interface TrendRadarLastRun {
|
|
138
|
+
at: string;
|
|
139
|
+
sourcesRead: number;
|
|
140
|
+
namesSeen: number;
|
|
141
|
+
searchesUsed: number;
|
|
142
|
+
}
|
|
143
|
+
interface TrendRadarSettings {
|
|
144
|
+
sources: TrendRadarSource[];
|
|
145
|
+
thresholds: TrendRadarThresholds;
|
|
146
|
+
alerts: TrendRadarAlerts;
|
|
147
|
+
retentionDays: number;
|
|
148
|
+
/** `HH:MM`, Israel time. */
|
|
149
|
+
runAt: string;
|
|
150
|
+
}
|
|
151
|
+
/** A source as {@link TrendRadarResource.updateSettings} takes it: without `id` it is added, with one it is updated, and one left out is removed. */
|
|
152
|
+
interface TrendRadarSourceInput {
|
|
153
|
+
id?: string;
|
|
154
|
+
name: string;
|
|
155
|
+
kind: TrendRadarSourceKind;
|
|
156
|
+
url: string | null;
|
|
157
|
+
enabled: boolean;
|
|
158
|
+
}
|
|
159
|
+
interface TrendRadarSettingsPatch {
|
|
160
|
+
sources?: TrendRadarSourceInput[];
|
|
161
|
+
thresholds?: Partial<TrendRadarThresholds>;
|
|
162
|
+
alerts?: Partial<TrendRadarAlerts>;
|
|
163
|
+
retentionDays?: number;
|
|
164
|
+
runAt?: string;
|
|
165
|
+
}
|
|
166
|
+
interface TrendRadarSummary {
|
|
167
|
+
lastRun: TrendRadarLastRun | null;
|
|
168
|
+
counts: {
|
|
169
|
+
candidates: number;
|
|
170
|
+
watching: number;
|
|
171
|
+
slowing: number;
|
|
172
|
+
};
|
|
173
|
+
searchesToday: number;
|
|
174
|
+
dailySearchBudget: number;
|
|
175
|
+
}
|
|
176
|
+
interface ListTrendCandidatesParams {
|
|
177
|
+
/** One status; left out = every candidate but the rejected and archived. */
|
|
178
|
+
status?: TrendCandidateStatus;
|
|
179
|
+
/** Default `creators`. */
|
|
180
|
+
sort?: TrendCandidateSort;
|
|
181
|
+
/** `next` of the previous page. */
|
|
182
|
+
cursor?: string;
|
|
183
|
+
/** 1–200, default 50. */
|
|
184
|
+
limit?: number;
|
|
185
|
+
}
|
|
186
|
+
interface TrendCandidatePage {
|
|
187
|
+
data: TrendCandidateCard[];
|
|
188
|
+
next: string | null;
|
|
189
|
+
}
|
|
190
|
+
/** What an approval made: the draft trend, and whether its source clip is on its way. */
|
|
191
|
+
interface TrendCandidateApproval {
|
|
192
|
+
trendId: string;
|
|
193
|
+
clip: "attaching" | "none";
|
|
194
|
+
}
|
|
195
|
+
declare class TrendRadarResource {
|
|
196
|
+
private client;
|
|
197
|
+
constructor(client: NodaroClientCore);
|
|
198
|
+
/** `GET /v1/trend-radar/summary` → the last run and the queue's counts. */
|
|
199
|
+
summary(): Promise<TrendRadarSummary>;
|
|
200
|
+
/** `GET /v1/trend-radar/candidates` → a page of candidate cards. */
|
|
201
|
+
candidates(params?: ListTrendCandidatesParams): Promise<TrendCandidatePage>;
|
|
202
|
+
/** `GET /v1/trend-radar/candidates/:id` → one candidate with its readings, posts and checklist. */
|
|
203
|
+
candidate(id: string): Promise<TrendCandidate>;
|
|
204
|
+
/**
|
|
205
|
+
* `POST /v1/trend-radar/candidates/:id/approve` → `{ trendId, clip }`:
|
|
206
|
+
* creates a DRAFT trend named after the candidate and marks the candidate
|
|
207
|
+
* approved. `clip` is `"attaching"` when the top post is being downloaded
|
|
208
|
+
* (as the approving admin) and stored as the draft's source clip in the
|
|
209
|
+
* background — the candidate's `history` then says `source_attached` or
|
|
210
|
+
* `source_failed` with why — and `"none"` when there is no top post or the
|
|
211
|
+
* candidate was approved before. Approving again answers the same trend.
|
|
212
|
+
*
|
|
213
|
+
* The clip's download is an import of a link: pass the `confirmationId`
|
|
214
|
+
* from `contentRights.confirm({ url: candidate.topPost.url, declarationVersion })` so the
|
|
215
|
+
* download is made under the admin's confirmation (required once the
|
|
216
|
+
* deployment turns `content_rights_required` on; without one then, the
|
|
217
|
+
* draft is still created and the clip is left out, `source_failed` saying why).
|
|
218
|
+
*/
|
|
219
|
+
approve(id: string, options?: {
|
|
220
|
+
confirmationId?: string;
|
|
221
|
+
}): Promise<TrendCandidateApproval>;
|
|
222
|
+
/** `POST /v1/trend-radar/candidates/:id/watch` → the card, back to `watching`. */
|
|
223
|
+
watch(id: string): Promise<TrendCandidateCard>;
|
|
224
|
+
/** `POST /v1/trend-radar/candidates/:id/reject` → the card, `rejected` with the reason (1–500 characters). */
|
|
225
|
+
reject(id: string, body: {
|
|
226
|
+
reason: string;
|
|
227
|
+
}): Promise<TrendCandidateCard>;
|
|
228
|
+
/** `GET /v1/trend-radar/settings` → the sources, thresholds, alerts, retention and run time. */
|
|
229
|
+
settings(): Promise<TrendRadarSettings>;
|
|
230
|
+
/**
|
|
231
|
+
* `PUT /v1/trend-radar/settings` → the settings after the change. Only the
|
|
232
|
+
* keys sent change; `sources` replaces the list whole. Whoever saves becomes
|
|
233
|
+
* the account the daily searches run as.
|
|
234
|
+
*/
|
|
235
|
+
updateSettings(patch: TrendRadarSettingsPatch): Promise<TrendRadarSettings>;
|
|
236
|
+
/** `POST /v1/trend-radar/run` → `{ runId, startedAt }`: starts today's run now (one at a time). */
|
|
237
|
+
run(): Promise<{
|
|
238
|
+
runId: string;
|
|
239
|
+
startedAt: string;
|
|
240
|
+
}>;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export { type ListTrendCandidatesParams, type TrendCandidate, type TrendCandidateApproval, type TrendCandidateCard, type TrendCandidateCheck, type TrendCandidateEvent, type TrendCandidateLabel, type TrendCandidatePage, type TrendCandidatePlatform, type TrendCandidatePost, type TrendCandidateReading, type TrendCandidateSearch, type TrendCandidateSort, type TrendCandidateSource, type TrendCandidateStatus, type TrendCandidateTemplate, type TrendRadarAlerts, type TrendRadarLastRun, TrendRadarResource, type TrendRadarSettings, type TrendRadarSettingsPatch, type TrendRadarSource, type TrendRadarSourceInput, type TrendRadarSourceKind, type TrendRadarSummary, type TrendRadarThresholds };
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { N as NodaroClientCore } from '../developer-apps-CMUzKpE9.js';
|
|
2
|
+
import '@nodaro/shared/apps';
|
|
3
|
+
import '@nodaro/shared/organizations';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Trend Radar — the daily run that finds candidate trends (a short clip
|
|
7
|
+
* several different creators recast within a few weeks) on Nodaro Cloud, and
|
|
8
|
+
* the admin's decisions on them. Mirrors `/v1/trend-radar/*`
|
|
9
|
+
* (`backend/src/ee/routes/trend-radar.ts`, shapes in
|
|
10
|
+
* `backend/src/ee/lib/trend-radar/types.ts`): keep the two in step.
|
|
11
|
+
*
|
|
12
|
+
* Every method answers a SIGNED-IN ADMIN SESSION only (`supabaseAuth`, the
|
|
13
|
+
* credential a first-party web app holds): an API key or an app's OAuth
|
|
14
|
+
* token gets `403 forbidden` (`ForbiddenError`), a signed-in non-admin too.
|
|
15
|
+
* A self-hosted instance has no radar (`NotFoundError`); Nodaro Cloud before
|
|
16
|
+
* its storage exists answers `503 not_available`.
|
|
17
|
+
*/
|
|
18
|
+
type TrendCandidateStatus = "watching" | "candidate" | "slowing" | "approved" | "rejected" | "archived";
|
|
19
|
+
type TrendCandidateLabel = "new" | "watching" | "rising" | "hot" | "slowing";
|
|
20
|
+
type TrendCandidateSort = "creators" | "dayChange" | "firstSeen";
|
|
21
|
+
type TrendRadarSourceKind = "sitemap" | "social" | "suggest";
|
|
22
|
+
type TrendCandidatePlatform = "tiktok" | "instagram" | "youtube";
|
|
23
|
+
/** Where a candidate was first seen: a template site's page, or a public post. */
|
|
24
|
+
interface TrendCandidateSource {
|
|
25
|
+
kind: "template-site" | "social";
|
|
26
|
+
name: string;
|
|
27
|
+
url: string | null;
|
|
28
|
+
firstSeenAt: string;
|
|
29
|
+
}
|
|
30
|
+
/** One public post as a link and its public counts. */
|
|
31
|
+
interface TrendCandidatePost {
|
|
32
|
+
platform: TrendCandidatePlatform;
|
|
33
|
+
url: string;
|
|
34
|
+
author: string;
|
|
35
|
+
postedAt: string | null;
|
|
36
|
+
/** `null` where the platform hides views to a logged-out reader (Instagram): read `likes`. */
|
|
37
|
+
plays: number | null;
|
|
38
|
+
likes: number | null;
|
|
39
|
+
soundName: string | null;
|
|
40
|
+
/** The platform's own still, when it gave one; a short-lived link. */
|
|
41
|
+
stillUrl: string | null;
|
|
42
|
+
/** The platform's own player for the post (`<iframe src>`), when it has one. */
|
|
43
|
+
embedUrl: string | null;
|
|
44
|
+
durationSec: number | null;
|
|
45
|
+
}
|
|
46
|
+
/** One day's reading: distinct creators, summed plays, posts returned. */
|
|
47
|
+
interface TrendCandidateReading {
|
|
48
|
+
/** `YYYY-MM-DD`, Israel time. */
|
|
49
|
+
date: string;
|
|
50
|
+
creators: number;
|
|
51
|
+
plays: number;
|
|
52
|
+
posts: number;
|
|
53
|
+
}
|
|
54
|
+
interface TrendCandidateCard {
|
|
55
|
+
id: string;
|
|
56
|
+
name: string;
|
|
57
|
+
slug: string;
|
|
58
|
+
status: TrendCandidateStatus;
|
|
59
|
+
label: TrendCandidateLabel;
|
|
60
|
+
soundName: string | null;
|
|
61
|
+
durationSec: number | null;
|
|
62
|
+
creators: number;
|
|
63
|
+
plays: number;
|
|
64
|
+
/** Plays growth from the previous reading, percent; `null` before two readings. */
|
|
65
|
+
dayChangePct: number | null;
|
|
66
|
+
firstSeen: TrendCandidateSource;
|
|
67
|
+
topPost: TrendCandidatePost | null;
|
|
68
|
+
/** When the candidate first reached the creator threshold. */
|
|
69
|
+
passedAt: string | null;
|
|
70
|
+
/** The draft trend an approval created. */
|
|
71
|
+
trendId: string | null;
|
|
72
|
+
createdAt: string;
|
|
73
|
+
updatedAt: string;
|
|
74
|
+
}
|
|
75
|
+
interface TrendCandidateTemplate {
|
|
76
|
+
site: string;
|
|
77
|
+
url: string;
|
|
78
|
+
since: string | null;
|
|
79
|
+
note: string | null;
|
|
80
|
+
}
|
|
81
|
+
interface TrendCandidateSearch {
|
|
82
|
+
/** Whether the search engine suggests "<name> ai"; `null` when not checked. */
|
|
83
|
+
suggest: boolean | null;
|
|
84
|
+
interest7d: {
|
|
85
|
+
from: number;
|
|
86
|
+
to: number;
|
|
87
|
+
} | null;
|
|
88
|
+
checkedAt: string;
|
|
89
|
+
}
|
|
90
|
+
interface TrendCandidateEvent {
|
|
91
|
+
at: string;
|
|
92
|
+
event: string;
|
|
93
|
+
detail: string | null;
|
|
94
|
+
}
|
|
95
|
+
/** A threshold the candidate is held to; `auto` is whether the last reading met it (`null`: not read yet). */
|
|
96
|
+
interface TrendCandidateCheck {
|
|
97
|
+
key: string;
|
|
98
|
+
label: string;
|
|
99
|
+
hint: string | null;
|
|
100
|
+
auto: boolean | null;
|
|
101
|
+
}
|
|
102
|
+
interface TrendCandidate extends TrendCandidateCard {
|
|
103
|
+
summary: string | null;
|
|
104
|
+
posts: TrendCandidatePost[];
|
|
105
|
+
/** Oldest first. */
|
|
106
|
+
readings: TrendCandidateReading[];
|
|
107
|
+
templatesElsewhere: TrendCandidateTemplate[];
|
|
108
|
+
search: TrendCandidateSearch | null;
|
|
109
|
+
/** Oldest first. */
|
|
110
|
+
history: TrendCandidateEvent[];
|
|
111
|
+
checklist: TrendCandidateCheck[];
|
|
112
|
+
rejectReason: string | null;
|
|
113
|
+
}
|
|
114
|
+
interface TrendRadarSource {
|
|
115
|
+
id: string;
|
|
116
|
+
name: string;
|
|
117
|
+
kind: TrendRadarSourceKind;
|
|
118
|
+
url: string | null;
|
|
119
|
+
enabled: boolean;
|
|
120
|
+
lastReadAt: string | null;
|
|
121
|
+
pages: number | null;
|
|
122
|
+
newToday: number | null;
|
|
123
|
+
lastError: string | null;
|
|
124
|
+
}
|
|
125
|
+
interface TrendRadarThresholds {
|
|
126
|
+
minCreators: number;
|
|
127
|
+
windowDays: number;
|
|
128
|
+
risingPct: number;
|
|
129
|
+
slowingPct: number;
|
|
130
|
+
maxClipSec: number;
|
|
131
|
+
dailySearchBudget: number;
|
|
132
|
+
}
|
|
133
|
+
interface TrendRadarAlerts {
|
|
134
|
+
slackNewCandidate: boolean;
|
|
135
|
+
slackDailySummary: boolean;
|
|
136
|
+
}
|
|
137
|
+
interface TrendRadarLastRun {
|
|
138
|
+
at: string;
|
|
139
|
+
sourcesRead: number;
|
|
140
|
+
namesSeen: number;
|
|
141
|
+
searchesUsed: number;
|
|
142
|
+
}
|
|
143
|
+
interface TrendRadarSettings {
|
|
144
|
+
sources: TrendRadarSource[];
|
|
145
|
+
thresholds: TrendRadarThresholds;
|
|
146
|
+
alerts: TrendRadarAlerts;
|
|
147
|
+
retentionDays: number;
|
|
148
|
+
/** `HH:MM`, Israel time. */
|
|
149
|
+
runAt: string;
|
|
150
|
+
}
|
|
151
|
+
/** A source as {@link TrendRadarResource.updateSettings} takes it: without `id` it is added, with one it is updated, and one left out is removed. */
|
|
152
|
+
interface TrendRadarSourceInput {
|
|
153
|
+
id?: string;
|
|
154
|
+
name: string;
|
|
155
|
+
kind: TrendRadarSourceKind;
|
|
156
|
+
url: string | null;
|
|
157
|
+
enabled: boolean;
|
|
158
|
+
}
|
|
159
|
+
interface TrendRadarSettingsPatch {
|
|
160
|
+
sources?: TrendRadarSourceInput[];
|
|
161
|
+
thresholds?: Partial<TrendRadarThresholds>;
|
|
162
|
+
alerts?: Partial<TrendRadarAlerts>;
|
|
163
|
+
retentionDays?: number;
|
|
164
|
+
runAt?: string;
|
|
165
|
+
}
|
|
166
|
+
interface TrendRadarSummary {
|
|
167
|
+
lastRun: TrendRadarLastRun | null;
|
|
168
|
+
counts: {
|
|
169
|
+
candidates: number;
|
|
170
|
+
watching: number;
|
|
171
|
+
slowing: number;
|
|
172
|
+
};
|
|
173
|
+
searchesToday: number;
|
|
174
|
+
dailySearchBudget: number;
|
|
175
|
+
}
|
|
176
|
+
interface ListTrendCandidatesParams {
|
|
177
|
+
/** One status; left out = every candidate but the rejected and archived. */
|
|
178
|
+
status?: TrendCandidateStatus;
|
|
179
|
+
/** Default `creators`. */
|
|
180
|
+
sort?: TrendCandidateSort;
|
|
181
|
+
/** `next` of the previous page. */
|
|
182
|
+
cursor?: string;
|
|
183
|
+
/** 1–200, default 50. */
|
|
184
|
+
limit?: number;
|
|
185
|
+
}
|
|
186
|
+
interface TrendCandidatePage {
|
|
187
|
+
data: TrendCandidateCard[];
|
|
188
|
+
next: string | null;
|
|
189
|
+
}
|
|
190
|
+
/** What an approval made: the draft trend, and whether its source clip is on its way. */
|
|
191
|
+
interface TrendCandidateApproval {
|
|
192
|
+
trendId: string;
|
|
193
|
+
clip: "attaching" | "none";
|
|
194
|
+
}
|
|
195
|
+
declare class TrendRadarResource {
|
|
196
|
+
private client;
|
|
197
|
+
constructor(client: NodaroClientCore);
|
|
198
|
+
/** `GET /v1/trend-radar/summary` → the last run and the queue's counts. */
|
|
199
|
+
summary(): Promise<TrendRadarSummary>;
|
|
200
|
+
/** `GET /v1/trend-radar/candidates` → a page of candidate cards. */
|
|
201
|
+
candidates(params?: ListTrendCandidatesParams): Promise<TrendCandidatePage>;
|
|
202
|
+
/** `GET /v1/trend-radar/candidates/:id` → one candidate with its readings, posts and checklist. */
|
|
203
|
+
candidate(id: string): Promise<TrendCandidate>;
|
|
204
|
+
/**
|
|
205
|
+
* `POST /v1/trend-radar/candidates/:id/approve` → `{ trendId, clip }`:
|
|
206
|
+
* creates a DRAFT trend named after the candidate and marks the candidate
|
|
207
|
+
* approved. `clip` is `"attaching"` when the top post is being downloaded
|
|
208
|
+
* (as the approving admin) and stored as the draft's source clip in the
|
|
209
|
+
* background — the candidate's `history` then says `source_attached` or
|
|
210
|
+
* `source_failed` with why — and `"none"` when there is no top post or the
|
|
211
|
+
* candidate was approved before. Approving again answers the same trend.
|
|
212
|
+
*
|
|
213
|
+
* The clip's download is an import of a link: pass the `confirmationId`
|
|
214
|
+
* from `contentRights.confirm({ url: candidate.topPost.url, declarationVersion })` so the
|
|
215
|
+
* download is made under the admin's confirmation (required once the
|
|
216
|
+
* deployment turns `content_rights_required` on; without one then, the
|
|
217
|
+
* draft is still created and the clip is left out, `source_failed` saying why).
|
|
218
|
+
*/
|
|
219
|
+
approve(id: string, options?: {
|
|
220
|
+
confirmationId?: string;
|
|
221
|
+
}): Promise<TrendCandidateApproval>;
|
|
222
|
+
/** `POST /v1/trend-radar/candidates/:id/watch` → the card, back to `watching`. */
|
|
223
|
+
watch(id: string): Promise<TrendCandidateCard>;
|
|
224
|
+
/** `POST /v1/trend-radar/candidates/:id/reject` → the card, `rejected` with the reason (1–500 characters). */
|
|
225
|
+
reject(id: string, body: {
|
|
226
|
+
reason: string;
|
|
227
|
+
}): Promise<TrendCandidateCard>;
|
|
228
|
+
/** `GET /v1/trend-radar/settings` → the sources, thresholds, alerts, retention and run time. */
|
|
229
|
+
settings(): Promise<TrendRadarSettings>;
|
|
230
|
+
/**
|
|
231
|
+
* `PUT /v1/trend-radar/settings` → the settings after the change. Only the
|
|
232
|
+
* keys sent change; `sources` replaces the list whole. Whoever saves becomes
|
|
233
|
+
* the account the daily searches run as.
|
|
234
|
+
*/
|
|
235
|
+
updateSettings(patch: TrendRadarSettingsPatch): Promise<TrendRadarSettings>;
|
|
236
|
+
/** `POST /v1/trend-radar/run` → `{ runId, startedAt }`: starts today's run now (one at a time). */
|
|
237
|
+
run(): Promise<{
|
|
238
|
+
runId: string;
|
|
239
|
+
startedAt: string;
|
|
240
|
+
}>;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export { type ListTrendCandidatesParams, type TrendCandidate, type TrendCandidateApproval, type TrendCandidateCard, type TrendCandidateCheck, type TrendCandidateEvent, type TrendCandidateLabel, type TrendCandidatePage, type TrendCandidatePlatform, type TrendCandidatePost, type TrendCandidateReading, type TrendCandidateSearch, type TrendCandidateSort, type TrendCandidateSource, type TrendCandidateStatus, type TrendCandidateTemplate, type TrendRadarAlerts, type TrendRadarLastRun, TrendRadarResource, type TrendRadarSettings, type TrendRadarSettingsPatch, type TrendRadarSource, type TrendRadarSourceInput, type TrendRadarSourceKind, type TrendRadarSummary, type TrendRadarThresholds };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"trend-radar.js"}
|
package/dist/entries/uploads.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('../chunk-ZE5RISBZ.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkUPGZTLK7_cjs = require('../chunk-UPGZTLK7.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "UploadsResource", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkUPGZTLK7_cjs.UploadsResource; }
|
|
11
11
|
});
|
|
12
12
|
//# sourceMappingURL=uploads.cjs.map
|
|
13
13
|
//# sourceMappingURL=uploads.cjs.map
|
|
@@ -55,8 +55,15 @@ declare class UploadsResource {
|
|
|
55
55
|
* `validation_error` (400: not an http(s) address, or not an image) or
|
|
56
56
|
* `fetch_failed` (422: the address could not be reached or answered with an
|
|
57
57
|
* error).
|
|
58
|
+
*
|
|
59
|
+
* An import of a link runs the platform's content rights check: pass the
|
|
60
|
+
* `confirmationId` from `contentRights.confirm({ url })` when the deployment
|
|
61
|
+
* requires one (`403 rights_confirmation_required` otherwise). A site an
|
|
62
|
+
* administrator disabled answers `403 import_source_disabled`.
|
|
58
63
|
*/
|
|
59
|
-
importUrl(url: string
|
|
64
|
+
importUrl(url: string, options?: {
|
|
65
|
+
confirmationId?: string;
|
|
66
|
+
}): Promise<ImportUrlResult>;
|
|
60
67
|
/**
|
|
61
68
|
* Store a JSON document (`POST /v1/upload-json`, up to 25 MB) and get its
|
|
62
69
|
* public URL — e.g. an image editor's design state, passed to
|
|
@@ -55,8 +55,15 @@ declare class UploadsResource {
|
|
|
55
55
|
* `validation_error` (400: not an http(s) address, or not an image) or
|
|
56
56
|
* `fetch_failed` (422: the address could not be reached or answered with an
|
|
57
57
|
* error).
|
|
58
|
+
*
|
|
59
|
+
* An import of a link runs the platform's content rights check: pass the
|
|
60
|
+
* `confirmationId` from `contentRights.confirm({ url })` when the deployment
|
|
61
|
+
* requires one (`403 rights_confirmation_required` otherwise). A site an
|
|
62
|
+
* administrator disabled answers `403 import_source_disabled`.
|
|
58
63
|
*/
|
|
59
|
-
importUrl(url: string
|
|
64
|
+
importUrl(url: string, options?: {
|
|
65
|
+
confirmationId?: string;
|
|
66
|
+
}): Promise<ImportUrlResult>;
|
|
60
67
|
/**
|
|
61
68
|
* Store a JSON document (`POST /v1/upload-json`, up to 25 MB) and get its
|
|
62
69
|
* public URL — e.g. an image editor's design state, passed to
|
package/dist/entries/uploads.js
CHANGED