faceless-cli 1.1.14 → 1.1.16
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/package.json +1 -1
- package/src/generated/operations.json +9 -5
- package/src/index.mjs +17 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"generatedFrom": "src/backend/api/v1/spec/registry.mjs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.16",
|
|
4
4
|
"baseUrl": "https://faceless.so/api/v1",
|
|
5
5
|
"operations": [
|
|
6
6
|
{
|
|
@@ -872,9 +872,11 @@
|
|
|
872
872
|
"postingDays": {
|
|
873
873
|
"type": "array",
|
|
874
874
|
"items": {
|
|
875
|
-
"type": "
|
|
875
|
+
"type": "integer",
|
|
876
|
+
"minimum": 0,
|
|
877
|
+
"maximum": 6
|
|
876
878
|
},
|
|
877
|
-
"description": "Days of the week to post, e.g. [
|
|
879
|
+
"description": "Days of the week to post as numbers, 0 is Sunday and 6 is Saturday, e.g. [1,3] for Monday and Wednesday. Omit for every day"
|
|
878
880
|
},
|
|
879
881
|
"timezone": {
|
|
880
882
|
"type": "string",
|
|
@@ -1133,9 +1135,11 @@
|
|
|
1133
1135
|
"postingDays": {
|
|
1134
1136
|
"type": "array",
|
|
1135
1137
|
"items": {
|
|
1136
|
-
"type": "
|
|
1138
|
+
"type": "integer",
|
|
1139
|
+
"minimum": 0,
|
|
1140
|
+
"maximum": 6
|
|
1137
1141
|
},
|
|
1138
|
-
"description": "Days of the week to post, e.g. [
|
|
1142
|
+
"description": "Days of the week to post as numbers, 0 is Sunday and 6 is Saturday, e.g. [1,3] for Monday and Wednesday. Omit for every day"
|
|
1139
1143
|
},
|
|
1140
1144
|
"timezone": {
|
|
1141
1145
|
"type": "string",
|
package/src/index.mjs
CHANGED
|
@@ -36,6 +36,18 @@ function splitList(value) {
|
|
|
36
36
|
.filter(Boolean);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
// The API takes posting days as numbers (0 = Sunday). Day names are accepted
|
|
40
|
+
// here because that is what a human types, and mapped before the request.
|
|
41
|
+
const DAY_NUMBERS = { sun: 0, mon: 1, tue: 2, wed: 3, thu: 4, fri: 5, sat: 6 };
|
|
42
|
+
|
|
43
|
+
function parseDays(value) {
|
|
44
|
+
return splitList(value).map((day) => {
|
|
45
|
+
const n = /^\d+$/.test(day) ? Number(day) : DAY_NUMBERS[day.slice(0, 3).toLowerCase()];
|
|
46
|
+
if (n === undefined || n < 0 || n > 6) throw new CliError("invalid_input", `Not a day: ${day} (use 0-6, 0 is Sunday, or a day name)`);
|
|
47
|
+
return n;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
39
51
|
function compact(obj) {
|
|
40
52
|
const out = {};
|
|
41
53
|
for (const [key, value] of Object.entries(obj)) {
|
|
@@ -131,7 +143,10 @@ function withSeriesFlags(command) {
|
|
|
131
143
|
.option("--destination <platform>", "primary auto-post destination, e.g. youtube or tiktok")
|
|
132
144
|
.option("--destination-accounts <id[,id...]>", "connected account ids to auto-post to (see: faceless accounts)")
|
|
133
145
|
.option("--auto-post-time <HH:mm>", "daily auto-post time in the series timezone")
|
|
134
|
-
.option(
|
|
146
|
+
.option(
|
|
147
|
+
"--posting-days <days>",
|
|
148
|
+
"comma-separated posting days as numbers 0-6 (0 is Sunday) or names, e.g. 1,3 or Monday,Wednesday (omit for every day)"
|
|
149
|
+
)
|
|
135
150
|
.option("--timezone <tz>", "IANA timezone for scheduling, e.g. America/New_York")
|
|
136
151
|
.option("--caption-style <name>", "caption theme name (see: faceless options --kind captionThemes)")
|
|
137
152
|
.option("--subreddit <name>", 'subreddit to pull posts from when source is "Reddit post"')
|
|
@@ -160,7 +175,7 @@ function seriesBody(opts) {
|
|
|
160
175
|
destination: opts.destination,
|
|
161
176
|
destinationAccounts: opts.destinationAccounts ? splitList(opts.destinationAccounts) : undefined,
|
|
162
177
|
autoPostTime: opts.autoPostTime,
|
|
163
|
-
postingDays: opts.postingDays ?
|
|
178
|
+
postingDays: opts.postingDays ? parseDays(opts.postingDays) : undefined,
|
|
164
179
|
timezone: opts.timezone,
|
|
165
180
|
captionStyle: opts.captionStyle,
|
|
166
181
|
subreddit: opts.subreddit,
|