@zanfia/cli 0.10.0 → 0.13.1
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 +16 -0
- package/dist/index.js +267 -122
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,6 +36,22 @@ zanfia emails test purchase-confirmation --lang en # queued to YOUR own addres
|
|
|
36
36
|
Raw HTTP: `GET|PATCH /email-templates`, `POST /email-templates/{key}/test-sends`. Full reference for every
|
|
37
37
|
command group: `.claude/skills/zanfia-cli/SKILL.md`.
|
|
38
38
|
|
|
39
|
+
## Community member keys (read-only option)
|
|
40
|
+
|
|
41
|
+
A member key acts as a creator's customer in their communities (Community API + the member MCP
|
|
42
|
+
tools), never in a workspace. Three ways to get one:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
zanfia login --address https://<creator-platform-url> [--read-only] # browser consent on that platform
|
|
46
|
+
zanfia join <handle> [--read-only] # public community, emailed code
|
|
47
|
+
zanfia auth set-key --api-url <api-community-url> <key> # key from the platform's settings
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`--read-only` (or „Tylko odczyt” when generating a key under **Settings → AI agents** on the
|
|
51
|
+
platform) grants `communities:read` only: the key reads and summarizes, and
|
|
52
|
+
every write (post, comment, chat, ticket) gets a 403 / a refused MCP tool. `zanfia auth status` and
|
|
53
|
+
`zanfia whoami` show the scope, e.g. `scope : communities:read (read-only)`.
|
|
54
|
+
|
|
39
55
|
## Auth resolution order
|
|
40
56
|
|
|
41
57
|
1. `--api-key` flag
|
package/dist/index.js
CHANGED
|
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
mod
|
|
34
34
|
));
|
|
35
35
|
|
|
36
|
-
// node_modules/commander/lib/error.js
|
|
36
|
+
// ../../../Zanfia2/apps/cli/node_modules/commander/lib/error.js
|
|
37
37
|
var require_error = __commonJS({
|
|
38
|
-
"node_modules/commander/lib/error.js"(exports) {
|
|
38
|
+
"../../../Zanfia2/apps/cli/node_modules/commander/lib/error.js"(exports) {
|
|
39
39
|
"use strict";
|
|
40
40
|
var CommanderError2 = class extends Error {
|
|
41
41
|
/**
|
|
@@ -69,9 +69,9 @@ var require_error = __commonJS({
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
// node_modules/commander/lib/argument.js
|
|
72
|
+
// ../../../Zanfia2/apps/cli/node_modules/commander/lib/argument.js
|
|
73
73
|
var require_argument = __commonJS({
|
|
74
|
-
"node_modules/commander/lib/argument.js"(exports) {
|
|
74
|
+
"../../../Zanfia2/apps/cli/node_modules/commander/lib/argument.js"(exports) {
|
|
75
75
|
"use strict";
|
|
76
76
|
var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
77
77
|
var Argument2 = class {
|
|
@@ -197,9 +197,9 @@ var require_argument = __commonJS({
|
|
|
197
197
|
}
|
|
198
198
|
});
|
|
199
199
|
|
|
200
|
-
// node_modules/commander/lib/help.js
|
|
200
|
+
// ../../../Zanfia2/apps/cli/node_modules/commander/lib/help.js
|
|
201
201
|
var require_help = __commonJS({
|
|
202
|
-
"node_modules/commander/lib/help.js"(exports) {
|
|
202
|
+
"../../../Zanfia2/apps/cli/node_modules/commander/lib/help.js"(exports) {
|
|
203
203
|
"use strict";
|
|
204
204
|
var { humanReadableArgName } = require_argument();
|
|
205
205
|
var Help2 = class {
|
|
@@ -612,9 +612,9 @@ var require_help = __commonJS({
|
|
|
612
612
|
}
|
|
613
613
|
});
|
|
614
614
|
|
|
615
|
-
// node_modules/commander/lib/option.js
|
|
615
|
+
// ../../../Zanfia2/apps/cli/node_modules/commander/lib/option.js
|
|
616
616
|
var require_option = __commonJS({
|
|
617
|
-
"node_modules/commander/lib/option.js"(exports) {
|
|
617
|
+
"../../../Zanfia2/apps/cli/node_modules/commander/lib/option.js"(exports) {
|
|
618
618
|
"use strict";
|
|
619
619
|
var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
620
620
|
var Option2 = class {
|
|
@@ -885,9 +885,9 @@ var require_option = __commonJS({
|
|
|
885
885
|
}
|
|
886
886
|
});
|
|
887
887
|
|
|
888
|
-
// node_modules/commander/lib/suggestSimilar.js
|
|
888
|
+
// ../../../Zanfia2/apps/cli/node_modules/commander/lib/suggestSimilar.js
|
|
889
889
|
var require_suggestSimilar = __commonJS({
|
|
890
|
-
"node_modules/commander/lib/suggestSimilar.js"(exports) {
|
|
890
|
+
"../../../Zanfia2/apps/cli/node_modules/commander/lib/suggestSimilar.js"(exports) {
|
|
891
891
|
"use strict";
|
|
892
892
|
var maxDistance = 3;
|
|
893
893
|
function editDistance(a, b) {
|
|
@@ -966,9 +966,9 @@ var require_suggestSimilar = __commonJS({
|
|
|
966
966
|
}
|
|
967
967
|
});
|
|
968
968
|
|
|
969
|
-
// node_modules/commander/lib/command.js
|
|
969
|
+
// ../../../Zanfia2/apps/cli/node_modules/commander/lib/command.js
|
|
970
970
|
var require_command = __commonJS({
|
|
971
|
-
"node_modules/commander/lib/command.js"(exports) {
|
|
971
|
+
"../../../Zanfia2/apps/cli/node_modules/commander/lib/command.js"(exports) {
|
|
972
972
|
"use strict";
|
|
973
973
|
var EventEmitter = __require("events").EventEmitter;
|
|
974
974
|
var childProcess = __require("child_process");
|
|
@@ -3010,9 +3010,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3010
3010
|
}
|
|
3011
3011
|
});
|
|
3012
3012
|
|
|
3013
|
-
// node_modules/commander/index.js
|
|
3013
|
+
// ../../../Zanfia2/apps/cli/node_modules/commander/index.js
|
|
3014
3014
|
var require_commander = __commonJS({
|
|
3015
|
-
"node_modules/commander/index.js"(exports) {
|
|
3015
|
+
"../../../Zanfia2/apps/cli/node_modules/commander/index.js"(exports) {
|
|
3016
3016
|
"use strict";
|
|
3017
3017
|
var { Argument: Argument2 } = require_argument();
|
|
3018
3018
|
var { Command: Command4 } = require_command();
|
|
@@ -3033,9 +3033,9 @@ var require_commander = __commonJS({
|
|
|
3033
3033
|
}
|
|
3034
3034
|
});
|
|
3035
3035
|
|
|
3036
|
-
//
|
|
3036
|
+
// ../../../Zanfia2/node_modules/requires-port/index.js
|
|
3037
3037
|
var require_requires_port = __commonJS({
|
|
3038
|
-
"
|
|
3038
|
+
"../../../Zanfia2/node_modules/requires-port/index.js"(exports, module) {
|
|
3039
3039
|
"use strict";
|
|
3040
3040
|
module.exports = function required(port, protocol) {
|
|
3041
3041
|
protocol = protocol.split(":")[0];
|
|
@@ -3060,9 +3060,9 @@ var require_requires_port = __commonJS({
|
|
|
3060
3060
|
}
|
|
3061
3061
|
});
|
|
3062
3062
|
|
|
3063
|
-
//
|
|
3063
|
+
// ../../../Zanfia2/node_modules/querystringify/index.js
|
|
3064
3064
|
var require_querystringify = __commonJS({
|
|
3065
|
-
"
|
|
3065
|
+
"../../../Zanfia2/node_modules/querystringify/index.js"(exports) {
|
|
3066
3066
|
"use strict";
|
|
3067
3067
|
var has = Object.prototype.hasOwnProperty;
|
|
3068
3068
|
var undef;
|
|
@@ -3112,9 +3112,9 @@ var require_querystringify = __commonJS({
|
|
|
3112
3112
|
}
|
|
3113
3113
|
});
|
|
3114
3114
|
|
|
3115
|
-
//
|
|
3115
|
+
// ../../../Zanfia2/node_modules/url-parse/index.js
|
|
3116
3116
|
var require_url_parse = __commonJS({
|
|
3117
|
-
"
|
|
3117
|
+
"../../../Zanfia2/node_modules/url-parse/index.js"(exports, module) {
|
|
3118
3118
|
"use strict";
|
|
3119
3119
|
var required = require_requires_port();
|
|
3120
3120
|
var qs = require_querystringify();
|
|
@@ -3420,9 +3420,9 @@ var require_url_parse = __commonJS({
|
|
|
3420
3420
|
}
|
|
3421
3421
|
});
|
|
3422
3422
|
|
|
3423
|
-
//
|
|
3423
|
+
// ../../../Zanfia2/node_modules/is-stream/index.js
|
|
3424
3424
|
var require_is_stream = __commonJS({
|
|
3425
|
-
"
|
|
3425
|
+
"../../../Zanfia2/node_modules/is-stream/index.js"(exports, module) {
|
|
3426
3426
|
"use strict";
|
|
3427
3427
|
var isStream2 = (stream) => stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
|
|
3428
3428
|
isStream2.writable = (stream) => isStream2(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
|
|
@@ -3433,9 +3433,9 @@ var require_is_stream = __commonJS({
|
|
|
3433
3433
|
}
|
|
3434
3434
|
});
|
|
3435
3435
|
|
|
3436
|
-
//
|
|
3436
|
+
// ../../../Zanfia2/node_modules/lodash.throttle/index.js
|
|
3437
3437
|
var require_lodash = __commonJS({
|
|
3438
|
-
"
|
|
3438
|
+
"../../../Zanfia2/node_modules/lodash.throttle/index.js"(exports, module) {
|
|
3439
3439
|
"use strict";
|
|
3440
3440
|
var FUNC_ERROR_TEXT = "Expected a function";
|
|
3441
3441
|
var NAN = 0 / 0;
|
|
@@ -3582,9 +3582,9 @@ var require_lodash = __commonJS({
|
|
|
3582
3582
|
}
|
|
3583
3583
|
});
|
|
3584
3584
|
|
|
3585
|
-
//
|
|
3585
|
+
// ../../../Zanfia2/node_modules/custom-error-instance/bin/factories.js
|
|
3586
3586
|
var require_factories = __commonJS({
|
|
3587
|
-
"
|
|
3587
|
+
"../../../Zanfia2/node_modules/custom-error-instance/bin/factories.js"(exports) {
|
|
3588
3588
|
"use strict";
|
|
3589
3589
|
exports.expectReceive = function(properties, configuration, factory) {
|
|
3590
3590
|
var message;
|
|
@@ -3655,9 +3655,9 @@ var require_factories = __commonJS({
|
|
|
3655
3655
|
}
|
|
3656
3656
|
});
|
|
3657
3657
|
|
|
3658
|
-
//
|
|
3658
|
+
// ../../../Zanfia2/node_modules/custom-error-instance/bin/error.js
|
|
3659
3659
|
var require_error2 = __commonJS({
|
|
3660
|
-
"
|
|
3660
|
+
"../../../Zanfia2/node_modules/custom-error-instance/bin/error.js"(exports, module) {
|
|
3661
3661
|
"use strict";
|
|
3662
3662
|
module.exports = CustomError;
|
|
3663
3663
|
CustomError.factory = require_factories();
|
|
@@ -3766,17 +3766,17 @@ var require_error2 = __commonJS({
|
|
|
3766
3766
|
}
|
|
3767
3767
|
});
|
|
3768
3768
|
|
|
3769
|
-
//
|
|
3769
|
+
// ../../../Zanfia2/node_modules/custom-error-instance/index.js
|
|
3770
3770
|
var require_custom_error_instance = __commonJS({
|
|
3771
|
-
"
|
|
3771
|
+
"../../../Zanfia2/node_modules/custom-error-instance/index.js"(exports, module) {
|
|
3772
3772
|
"use strict";
|
|
3773
3773
|
module.exports = require_error2();
|
|
3774
3774
|
}
|
|
3775
3775
|
});
|
|
3776
3776
|
|
|
3777
|
-
//
|
|
3777
|
+
// ../../../Zanfia2/node_modules/lodash._basetostring/index.js
|
|
3778
3778
|
var require_lodash2 = __commonJS({
|
|
3779
|
-
"
|
|
3779
|
+
"../../../Zanfia2/node_modules/lodash._basetostring/index.js"(exports, module) {
|
|
3780
3780
|
"use strict";
|
|
3781
3781
|
var INFINITY = 1 / 0;
|
|
3782
3782
|
var symbolTag = "[object Symbol]";
|
|
@@ -3819,9 +3819,9 @@ var require_lodash2 = __commonJS({
|
|
|
3819
3819
|
}
|
|
3820
3820
|
});
|
|
3821
3821
|
|
|
3822
|
-
//
|
|
3822
|
+
// ../../../Zanfia2/node_modules/lodash._stringtopath/index.js
|
|
3823
3823
|
var require_lodash3 = __commonJS({
|
|
3824
|
-
"
|
|
3824
|
+
"../../../Zanfia2/node_modules/lodash._stringtopath/index.js"(exports, module) {
|
|
3825
3825
|
"use strict";
|
|
3826
3826
|
var baseToString = require_lodash2();
|
|
3827
3827
|
var FUNC_ERROR_TEXT = "Expected a function";
|
|
@@ -4064,9 +4064,9 @@ var require_lodash3 = __commonJS({
|
|
|
4064
4064
|
}
|
|
4065
4065
|
});
|
|
4066
4066
|
|
|
4067
|
-
//
|
|
4067
|
+
// ../../../Zanfia2/node_modules/lodash._baseiteratee/index.js
|
|
4068
4068
|
var require_lodash4 = __commonJS({
|
|
4069
|
-
"
|
|
4069
|
+
"../../../Zanfia2/node_modules/lodash._baseiteratee/index.js"(exports, module) {
|
|
4070
4070
|
"use strict";
|
|
4071
4071
|
var stringToPath = require_lodash3();
|
|
4072
4072
|
var LARGE_ARRAY_SIZE = 200;
|
|
@@ -4835,9 +4835,9 @@ var require_lodash4 = __commonJS({
|
|
|
4835
4835
|
}
|
|
4836
4836
|
});
|
|
4837
4837
|
|
|
4838
|
-
//
|
|
4838
|
+
// ../../../Zanfia2/node_modules/lodash._createset/index.js
|
|
4839
4839
|
var require_lodash5 = __commonJS({
|
|
4840
|
-
"
|
|
4840
|
+
"../../../Zanfia2/node_modules/lodash._createset/index.js"(exports, module) {
|
|
4841
4841
|
"use strict";
|
|
4842
4842
|
var INFINITY = 1 / 0;
|
|
4843
4843
|
var funcTag = "[object Function]";
|
|
@@ -4924,9 +4924,9 @@ var require_lodash5 = __commonJS({
|
|
|
4924
4924
|
}
|
|
4925
4925
|
});
|
|
4926
4926
|
|
|
4927
|
-
//
|
|
4927
|
+
// ../../../Zanfia2/node_modules/lodash._root/index.js
|
|
4928
4928
|
var require_lodash6 = __commonJS({
|
|
4929
|
-
"
|
|
4929
|
+
"../../../Zanfia2/node_modules/lodash._root/index.js"(exports, module) {
|
|
4930
4930
|
"use strict";
|
|
4931
4931
|
var objectTypes = {
|
|
4932
4932
|
"function": true,
|
|
@@ -4946,9 +4946,9 @@ var require_lodash6 = __commonJS({
|
|
|
4946
4946
|
}
|
|
4947
4947
|
});
|
|
4948
4948
|
|
|
4949
|
-
//
|
|
4949
|
+
// ../../../Zanfia2/node_modules/lodash._baseuniq/index.js
|
|
4950
4950
|
var require_lodash7 = __commonJS({
|
|
4951
|
-
"
|
|
4951
|
+
"../../../Zanfia2/node_modules/lodash._baseuniq/index.js"(exports, module) {
|
|
4952
4952
|
"use strict";
|
|
4953
4953
|
var createSet = require_lodash5();
|
|
4954
4954
|
var root = require_lodash6();
|
|
@@ -5249,9 +5249,9 @@ var require_lodash7 = __commonJS({
|
|
|
5249
5249
|
}
|
|
5250
5250
|
});
|
|
5251
5251
|
|
|
5252
|
-
//
|
|
5252
|
+
// ../../../Zanfia2/node_modules/combine-errors/node_modules/lodash.uniqby/index.js
|
|
5253
5253
|
var require_lodash8 = __commonJS({
|
|
5254
|
-
"
|
|
5254
|
+
"../../../Zanfia2/node_modules/combine-errors/node_modules/lodash.uniqby/index.js"(exports, module) {
|
|
5255
5255
|
"use strict";
|
|
5256
5256
|
var baseIteratee = require_lodash4();
|
|
5257
5257
|
var baseUniq = require_lodash7();
|
|
@@ -5262,9 +5262,9 @@ var require_lodash8 = __commonJS({
|
|
|
5262
5262
|
}
|
|
5263
5263
|
});
|
|
5264
5264
|
|
|
5265
|
-
//
|
|
5265
|
+
// ../../../Zanfia2/node_modules/combine-errors/index.js
|
|
5266
5266
|
var require_combine_errors = __commonJS({
|
|
5267
|
-
"
|
|
5267
|
+
"../../../Zanfia2/node_modules/combine-errors/index.js"(exports, module) {
|
|
5268
5268
|
"use strict";
|
|
5269
5269
|
var Custom = require_custom_error_instance();
|
|
5270
5270
|
var uniq = require_lodash8();
|
|
@@ -5298,9 +5298,9 @@ var require_combine_errors = __commonJS({
|
|
|
5298
5298
|
}
|
|
5299
5299
|
});
|
|
5300
5300
|
|
|
5301
|
-
//
|
|
5301
|
+
// ../../../Zanfia2/node_modules/graceful-fs/polyfills.js
|
|
5302
5302
|
var require_polyfills = __commonJS({
|
|
5303
|
-
"
|
|
5303
|
+
"../../../Zanfia2/node_modules/graceful-fs/polyfills.js"(exports, module) {
|
|
5304
5304
|
"use strict";
|
|
5305
5305
|
var constants = __require("constants");
|
|
5306
5306
|
var origCwd = process.cwd;
|
|
@@ -5587,9 +5587,9 @@ var require_polyfills = __commonJS({
|
|
|
5587
5587
|
}
|
|
5588
5588
|
});
|
|
5589
5589
|
|
|
5590
|
-
//
|
|
5590
|
+
// ../../../Zanfia2/node_modules/graceful-fs/legacy-streams.js
|
|
5591
5591
|
var require_legacy_streams = __commonJS({
|
|
5592
|
-
"
|
|
5592
|
+
"../../../Zanfia2/node_modules/graceful-fs/legacy-streams.js"(exports, module) {
|
|
5593
5593
|
"use strict";
|
|
5594
5594
|
var Stream = __require("stream").Stream;
|
|
5595
5595
|
module.exports = legacy;
|
|
@@ -5684,9 +5684,9 @@ var require_legacy_streams = __commonJS({
|
|
|
5684
5684
|
}
|
|
5685
5685
|
});
|
|
5686
5686
|
|
|
5687
|
-
//
|
|
5687
|
+
// ../../../Zanfia2/node_modules/graceful-fs/clone.js
|
|
5688
5688
|
var require_clone = __commonJS({
|
|
5689
|
-
"
|
|
5689
|
+
"../../../Zanfia2/node_modules/graceful-fs/clone.js"(exports, module) {
|
|
5690
5690
|
"use strict";
|
|
5691
5691
|
module.exports = clone;
|
|
5692
5692
|
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
@@ -5707,9 +5707,9 @@ var require_clone = __commonJS({
|
|
|
5707
5707
|
}
|
|
5708
5708
|
});
|
|
5709
5709
|
|
|
5710
|
-
//
|
|
5710
|
+
// ../../../Zanfia2/node_modules/graceful-fs/graceful-fs.js
|
|
5711
5711
|
var require_graceful_fs = __commonJS({
|
|
5712
|
-
"
|
|
5712
|
+
"../../../Zanfia2/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
|
|
5713
5713
|
"use strict";
|
|
5714
5714
|
var fs2 = __require("fs");
|
|
5715
5715
|
var polyfills = require_polyfills();
|
|
@@ -6078,9 +6078,9 @@ var require_graceful_fs = __commonJS({
|
|
|
6078
6078
|
}
|
|
6079
6079
|
});
|
|
6080
6080
|
|
|
6081
|
-
//
|
|
6081
|
+
// ../../../Zanfia2/node_modules/proper-lockfile/node_modules/retry/lib/retry_operation.js
|
|
6082
6082
|
var require_retry_operation = __commonJS({
|
|
6083
|
-
"
|
|
6083
|
+
"../../../Zanfia2/node_modules/proper-lockfile/node_modules/retry/lib/retry_operation.js"(exports, module) {
|
|
6084
6084
|
"use strict";
|
|
6085
6085
|
function RetryOperation(timeouts, options) {
|
|
6086
6086
|
if (typeof options === "boolean") {
|
|
@@ -6210,9 +6210,9 @@ var require_retry_operation = __commonJS({
|
|
|
6210
6210
|
}
|
|
6211
6211
|
});
|
|
6212
6212
|
|
|
6213
|
-
//
|
|
6213
|
+
// ../../../Zanfia2/node_modules/proper-lockfile/node_modules/retry/lib/retry.js
|
|
6214
6214
|
var require_retry = __commonJS({
|
|
6215
|
-
"
|
|
6215
|
+
"../../../Zanfia2/node_modules/proper-lockfile/node_modules/retry/lib/retry.js"(exports) {
|
|
6216
6216
|
"use strict";
|
|
6217
6217
|
var RetryOperation = require_retry_operation();
|
|
6218
6218
|
exports.operation = function(options) {
|
|
@@ -6297,17 +6297,17 @@ var require_retry = __commonJS({
|
|
|
6297
6297
|
}
|
|
6298
6298
|
});
|
|
6299
6299
|
|
|
6300
|
-
//
|
|
6300
|
+
// ../../../Zanfia2/node_modules/proper-lockfile/node_modules/retry/index.js
|
|
6301
6301
|
var require_retry2 = __commonJS({
|
|
6302
|
-
"
|
|
6302
|
+
"../../../Zanfia2/node_modules/proper-lockfile/node_modules/retry/index.js"(exports, module) {
|
|
6303
6303
|
"use strict";
|
|
6304
6304
|
module.exports = require_retry();
|
|
6305
6305
|
}
|
|
6306
6306
|
});
|
|
6307
6307
|
|
|
6308
|
-
//
|
|
6308
|
+
// ../../../Zanfia2/node_modules/proper-lockfile/node_modules/signal-exit/signals.js
|
|
6309
6309
|
var require_signals = __commonJS({
|
|
6310
|
-
"
|
|
6310
|
+
"../../../Zanfia2/node_modules/proper-lockfile/node_modules/signal-exit/signals.js"(exports, module) {
|
|
6311
6311
|
"use strict";
|
|
6312
6312
|
module.exports = [
|
|
6313
6313
|
"SIGABRT",
|
|
@@ -6343,9 +6343,9 @@ var require_signals = __commonJS({
|
|
|
6343
6343
|
}
|
|
6344
6344
|
});
|
|
6345
6345
|
|
|
6346
|
-
//
|
|
6346
|
+
// ../../../Zanfia2/node_modules/proper-lockfile/node_modules/signal-exit/index.js
|
|
6347
6347
|
var require_signal_exit = __commonJS({
|
|
6348
|
-
"
|
|
6348
|
+
"../../../Zanfia2/node_modules/proper-lockfile/node_modules/signal-exit/index.js"(exports, module) {
|
|
6349
6349
|
"use strict";
|
|
6350
6350
|
var process2 = global.process;
|
|
6351
6351
|
var processOk = function(process3) {
|
|
@@ -6503,9 +6503,9 @@ var require_signal_exit = __commonJS({
|
|
|
6503
6503
|
}
|
|
6504
6504
|
});
|
|
6505
6505
|
|
|
6506
|
-
//
|
|
6506
|
+
// ../../../Zanfia2/node_modules/proper-lockfile/lib/mtime-precision.js
|
|
6507
6507
|
var require_mtime_precision = __commonJS({
|
|
6508
|
-
"
|
|
6508
|
+
"../../../Zanfia2/node_modules/proper-lockfile/lib/mtime-precision.js"(exports, module) {
|
|
6509
6509
|
"use strict";
|
|
6510
6510
|
var cacheSymbol = /* @__PURE__ */ Symbol();
|
|
6511
6511
|
function probe(file, fs2, callback) {
|
|
@@ -6545,9 +6545,9 @@ var require_mtime_precision = __commonJS({
|
|
|
6545
6545
|
}
|
|
6546
6546
|
});
|
|
6547
6547
|
|
|
6548
|
-
//
|
|
6548
|
+
// ../../../Zanfia2/node_modules/proper-lockfile/lib/lockfile.js
|
|
6549
6549
|
var require_lockfile = __commonJS({
|
|
6550
|
-
"
|
|
6550
|
+
"../../../Zanfia2/node_modules/proper-lockfile/lib/lockfile.js"(exports, module) {
|
|
6551
6551
|
"use strict";
|
|
6552
6552
|
var path2 = __require("path");
|
|
6553
6553
|
var fs2 = require_graceful_fs();
|
|
@@ -6782,9 +6782,9 @@ var require_lockfile = __commonJS({
|
|
|
6782
6782
|
}
|
|
6783
6783
|
});
|
|
6784
6784
|
|
|
6785
|
-
//
|
|
6785
|
+
// ../../../Zanfia2/node_modules/proper-lockfile/lib/adapter.js
|
|
6786
6786
|
var require_adapter = __commonJS({
|
|
6787
|
-
"
|
|
6787
|
+
"../../../Zanfia2/node_modules/proper-lockfile/lib/adapter.js"(exports, module) {
|
|
6788
6788
|
"use strict";
|
|
6789
6789
|
var fs2 = require_graceful_fs();
|
|
6790
6790
|
function createSyncFs(fs3) {
|
|
@@ -6847,9 +6847,9 @@ var require_adapter = __commonJS({
|
|
|
6847
6847
|
}
|
|
6848
6848
|
});
|
|
6849
6849
|
|
|
6850
|
-
//
|
|
6850
|
+
// ../../../Zanfia2/node_modules/proper-lockfile/index.js
|
|
6851
6851
|
var require_proper_lockfile = __commonJS({
|
|
6852
|
-
"
|
|
6852
|
+
"../../../Zanfia2/node_modules/proper-lockfile/index.js"(exports, module) {
|
|
6853
6853
|
"use strict";
|
|
6854
6854
|
var lockfile2 = require_lockfile();
|
|
6855
6855
|
var { toPromise, toSync, toSyncOptions } = require_adapter();
|
|
@@ -6883,7 +6883,7 @@ var require_proper_lockfile = __commonJS({
|
|
|
6883
6883
|
}
|
|
6884
6884
|
});
|
|
6885
6885
|
|
|
6886
|
-
// node_modules/commander/esm.mjs
|
|
6886
|
+
// ../../../Zanfia2/apps/cli/node_modules/commander/esm.mjs
|
|
6887
6887
|
var import_index = __toESM(require_commander(), 1);
|
|
6888
6888
|
var {
|
|
6889
6889
|
program,
|
|
@@ -7047,6 +7047,18 @@ function resolveApiKey(explicit) {
|
|
|
7047
7047
|
const stored = readCredentials();
|
|
7048
7048
|
return stored?.apiKey ?? null;
|
|
7049
7049
|
}
|
|
7050
|
+
var MEMBER_WRITE_SCOPE = "communities:write";
|
|
7051
|
+
var FULL_MEMBER_SCOPES = ["communities:read", "communities:write"];
|
|
7052
|
+
function memberKeyScopes(claims) {
|
|
7053
|
+
return claims.scopes ?? [...FULL_MEMBER_SCOPES];
|
|
7054
|
+
}
|
|
7055
|
+
function isReadOnlyMemberKey(claims) {
|
|
7056
|
+
return !memberKeyScopes(claims).includes(MEMBER_WRITE_SCOPE);
|
|
7057
|
+
}
|
|
7058
|
+
function memberScopeLabel(claims) {
|
|
7059
|
+
const scopes = memberKeyScopes(claims).join(", ");
|
|
7060
|
+
return isReadOnlyMemberKey(claims) ? `${scopes} (read-only)` : scopes;
|
|
7061
|
+
}
|
|
7050
7062
|
function decodeTokenClaims(token) {
|
|
7051
7063
|
if (!token) return { kind: "workspace" };
|
|
7052
7064
|
const parts = token.split(".");
|
|
@@ -7057,7 +7069,8 @@ function decodeTokenClaims(token) {
|
|
|
7057
7069
|
kind: p.kind === "member" ? "member" : "workspace",
|
|
7058
7070
|
workspaceId: typeof p.wsp === "string" ? p.wsp : void 0,
|
|
7059
7071
|
subject: typeof p.sub === "string" ? p.sub : void 0,
|
|
7060
|
-
expiresAt: typeof p.exp === "number" ? new Date(p.exp * 1e3).toISOString() : void 0
|
|
7072
|
+
expiresAt: typeof p.exp === "number" ? new Date(p.exp * 1e3).toISOString() : void 0,
|
|
7073
|
+
scopes: typeof p.scope === "string" ? p.scope.split(" ").filter(Boolean) : void 0
|
|
7061
7074
|
};
|
|
7062
7075
|
} catch {
|
|
7063
7076
|
return { kind: "workspace" };
|
|
@@ -10595,6 +10608,84 @@ function registerCertificatesCommands(program2) {
|
|
|
10595
10608
|
);
|
|
10596
10609
|
emit(flags, result ?? {}, () => printJson(result ?? {}));
|
|
10597
10610
|
});
|
|
10611
|
+
const certificatesSettings = certificates.command("settings");
|
|
10612
|
+
certificatesSettings.description(
|
|
10613
|
+
"A course's or event's certificate settings (auto-issue, layout, numbering, date, claim)"
|
|
10614
|
+
);
|
|
10615
|
+
certificatesSettings.command("get").summary("A product's certificate settings").description(
|
|
10616
|
+
'Certificate settings of one course or event product \u2014 the same fields as the dashboard\'s product Settings \u2192 Certificate section: `certificateEnabled` (automatic certificate on course completion; courses only, always false for an event), `certificateTemplateId` (null = the workspace default template), `certificateCustomText` (the extra line printed by templates with the "custom text" element), `certificateValidityMonths` (null = never expires), numbering (`certificateCode`), the printed date (`certificateDateMode` + `certificateTrainingDate`) and claim mode (`certificateClaimEnabled` + `certificateClaimAvailableFrom`). 404 for an unknown product, 400 for a product type without certificates.'
|
|
10617
|
+
).argument("<productId>", "Course or event product id (other product types answer 400).").action(async (productId, _options, command) => {
|
|
10618
|
+
const flags = getGlobalFlags(command);
|
|
10619
|
+
const client = createApiClient({ apiKey: flags.apiKey, verbose: flags.verbose });
|
|
10620
|
+
const params = {
|
|
10621
|
+
productId
|
|
10622
|
+
};
|
|
10623
|
+
const result = await client.call(
|
|
10624
|
+
"GET",
|
|
10625
|
+
"/products/:productId/certificate-settings",
|
|
10626
|
+
params,
|
|
10627
|
+
void 0,
|
|
10628
|
+
void 0
|
|
10629
|
+
);
|
|
10630
|
+
emit(flags, result ?? {}, () => printJson(result ?? {}));
|
|
10631
|
+
});
|
|
10632
|
+
certificatesSettings.command("update").summary("Update a product's certificate settings").description(
|
|
10633
|
+
"Partial update of one course or event product's certificate settings \u2014 what the dashboard's product Settings \u2192 Certificate section saves: automatic certificate on course completion (`certificateEnabled`, courses only), layout (`certificateTemplateId`), the extra line (`certificateCustomText`, max 300 characters / 3 lines), validity, numbering (`certificateCode`), the printed date (`certificateDateMode` + `certificateTrainingDate`) and claim mode (`certificateClaimEnabled` + `certificateClaimAvailableFrom`). Absent fields stay unchanged, null clears; an empty body is a 400. The whole patch is checked before anything is saved (409 taken code, 404 unknown product or template, 400 invalid value). Only certificates issued from now on use the new settings. Answers the settings as saved."
|
|
10634
|
+
).argument("<productId>", "Course or event product id (other product types answer 400).").option(
|
|
10635
|
+
"--auto-issue",
|
|
10636
|
+
"Automatic certificate on course completion. Course products only (400 on an event)."
|
|
10637
|
+
).option("--no-auto-issue", "Send `certificateEnabled: false` explicitly.").option(
|
|
10638
|
+
"--template <value>",
|
|
10639
|
+
"Certificate template id from list-certificate-templates (404 when not in this workspace); null or blank = back to the workspace default."
|
|
10640
|
+
).option(
|
|
10641
|
+
"--custom-text <value>",
|
|
10642
|
+
'Extra line printed by templates with the "custom text" element, e.g. training hours. Max 300 characters and 3 lines (line breaks kept); null or blank clears it.'
|
|
10643
|
+
).option(
|
|
10644
|
+
"--validity-months <n>",
|
|
10645
|
+
"Validity in months from issuance; null = never expires.",
|
|
10646
|
+
parseNumberOption("--validity-months", NumberFormat.Integer)
|
|
10647
|
+
).option(
|
|
10648
|
+
"--code <value>",
|
|
10649
|
+
"Exactly 3 digits (`017`), unique in the workspace (409 when another product has it); numbers certificates `{seq}/{code}/{schoolYear}`. null or blank = unnumbered."
|
|
10650
|
+
).addOption(
|
|
10651
|
+
new Option(
|
|
10652
|
+
"--date-mode <completion|training_date|issue_date>",
|
|
10653
|
+
"Printed date: `completion` (course progress, else the issue date), `training_date` (needs certificateTrainingDate) or `issue_date`. null = completion."
|
|
10654
|
+
).choices(["completion", "training_date", "issue_date"])
|
|
10655
|
+
).option(
|
|
10656
|
+
"--training-date <value>",
|
|
10657
|
+
"`YYYY-MM-DD`, printed in the `training_date` mode; null or blank clears."
|
|
10658
|
+
).option("--claim", "Participants claim the certificate themselves in the portal (claim mode).").option("--no-claim", "Send `certificateClaimEnabled: false` explicitly.").option(
|
|
10659
|
+
"--claim-from <value>",
|
|
10660
|
+
"First claim day `YYYY-MM-DD`; null or blank = the day after the training date (else at once)."
|
|
10661
|
+
).action(
|
|
10662
|
+
async (productId, options, command) => {
|
|
10663
|
+
const flags = getGlobalFlags(command);
|
|
10664
|
+
const client = createApiClient({ apiKey: flags.apiKey, verbose: flags.verbose });
|
|
10665
|
+
const params = {
|
|
10666
|
+
productId
|
|
10667
|
+
};
|
|
10668
|
+
const payload = {
|
|
10669
|
+
certificateEnabled: options.autoIssue,
|
|
10670
|
+
certificateTemplateId: options.template,
|
|
10671
|
+
certificateCustomText: options.customText,
|
|
10672
|
+
certificateValidityMonths: options.validityMonths,
|
|
10673
|
+
certificateCode: options.code,
|
|
10674
|
+
certificateDateMode: options.dateMode,
|
|
10675
|
+
certificateTrainingDate: options.trainingDate,
|
|
10676
|
+
certificateClaimEnabled: options.claim,
|
|
10677
|
+
certificateClaimAvailableFrom: options.claimFrom
|
|
10678
|
+
};
|
|
10679
|
+
const result = await client.call(
|
|
10680
|
+
"PATCH",
|
|
10681
|
+
"/products/:productId/certificate-settings",
|
|
10682
|
+
params,
|
|
10683
|
+
void 0,
|
|
10684
|
+
payload
|
|
10685
|
+
);
|
|
10686
|
+
emit(flags, result ?? {}, () => printJson(result ?? {}));
|
|
10687
|
+
}
|
|
10688
|
+
);
|
|
10598
10689
|
}
|
|
10599
10690
|
|
|
10600
10691
|
// src/commands/_generated/blog.ts
|
|
@@ -11615,7 +11706,8 @@ async function runWhoami(command) {
|
|
|
11615
11706
|
workspaceName: stored?.workspaceName ?? null,
|
|
11616
11707
|
userEmail: stored?.userEmail ?? null,
|
|
11617
11708
|
uid: claims.subject ?? null,
|
|
11618
|
-
scopes:
|
|
11709
|
+
scopes: memberKeyScopes(claims),
|
|
11710
|
+
readOnly: isReadOnlyMemberKey(claims),
|
|
11619
11711
|
communityApiUrl: resolveCommunityApiUrl()
|
|
11620
11712
|
};
|
|
11621
11713
|
emit(flags, info2, () => {
|
|
@@ -11629,7 +11721,7 @@ async function runWhoami(command) {
|
|
|
11629
11721
|
`);
|
|
11630
11722
|
else if (info2.uid) process.stdout.write(`User id: ${info2.uid}
|
|
11631
11723
|
`);
|
|
11632
|
-
process.stdout.write(`Scopes: ${
|
|
11724
|
+
process.stdout.write(`Scopes: ${memberScopeLabel(claims)}
|
|
11633
11725
|
`);
|
|
11634
11726
|
process.stdout.write(`Community API: ${info2.communityApiUrl ?? "<unresolved>"}
|
|
11635
11727
|
`);
|
|
@@ -11685,10 +11777,15 @@ function registerAuthCommands(program2) {
|
|
|
11685
11777
|
process.stdout.write(` status: no credentials file found
|
|
11686
11778
|
`);
|
|
11687
11779
|
} else {
|
|
11780
|
+
const storedClaims = decodeTokenClaims(stored.apiKey);
|
|
11688
11781
|
process.stdout.write(` source: ${stored.source ?? "manual"}
|
|
11689
11782
|
`);
|
|
11690
|
-
process.stdout.write(` kind : ${stored.kind ??
|
|
11783
|
+
process.stdout.write(` kind : ${stored.kind ?? storedClaims.kind}
|
|
11691
11784
|
`);
|
|
11785
|
+
if (storedClaims.kind === "member") {
|
|
11786
|
+
process.stdout.write(` scope : ${memberScopeLabel(storedClaims)}
|
|
11787
|
+
`);
|
|
11788
|
+
}
|
|
11692
11789
|
process.stdout.write(` saved : ${stored.savedAt}
|
|
11693
11790
|
`);
|
|
11694
11791
|
if (stored.userEmail) {
|
|
@@ -11726,6 +11823,8 @@ Resolved by next call:
|
|
|
11726
11823
|
process.stdout.write(` kind : ${kind}
|
|
11727
11824
|
`);
|
|
11728
11825
|
if (kind === "member") {
|
|
11826
|
+
process.stdout.write(` scope : ${memberScopeLabel(decodeTokenClaims(apiKey))}
|
|
11827
|
+
`);
|
|
11729
11828
|
process.stdout.write(
|
|
11730
11829
|
` community API: ${resolveCommunityApiUrl() ?? "<unresolved \u2014 set --api-url>"}
|
|
11731
11830
|
`
|
|
@@ -11741,7 +11840,8 @@ Resolved by next call:
|
|
|
11741
11840
|
"--api-url <url>",
|
|
11742
11841
|
"API URL to associate with this key (for member keys, the api-community URL)"
|
|
11743
11842
|
).action((key, options) => {
|
|
11744
|
-
const
|
|
11843
|
+
const claims = decodeTokenClaims(key);
|
|
11844
|
+
const { kind } = claims;
|
|
11745
11845
|
const path2 = writeCredentials({
|
|
11746
11846
|
apiKey: key,
|
|
11747
11847
|
apiUrl: options.apiUrl,
|
|
@@ -11749,7 +11849,8 @@ Resolved by next call:
|
|
|
11749
11849
|
source: "manual",
|
|
11750
11850
|
kind
|
|
11751
11851
|
});
|
|
11752
|
-
|
|
11852
|
+
const label = kind === "member" ? isReadOnlyMemberKey(claims) ? "read-only member " : "member " : "";
|
|
11853
|
+
process.stdout.write(`Saved ${label}API key to ${path2}
|
|
11753
11854
|
`);
|
|
11754
11855
|
if (kind === "member" && !options.apiUrl) {
|
|
11755
11856
|
process.stdout.write(
|
|
@@ -12054,6 +12155,17 @@ async function runBrowserAuth(options, entryUrl) {
|
|
|
12054
12155
|
server.close();
|
|
12055
12156
|
}
|
|
12056
12157
|
}
|
|
12158
|
+
function buildMemberConsentParams(input) {
|
|
12159
|
+
return {
|
|
12160
|
+
redirect_uri: input.redirectUri,
|
|
12161
|
+
state: input.state,
|
|
12162
|
+
code_challenge: input.challenge,
|
|
12163
|
+
code_challenge_method: "S256",
|
|
12164
|
+
hostname: input.hostname,
|
|
12165
|
+
client: "zanfia-cli",
|
|
12166
|
+
...input.readOnly ? { read_only: "1" } : null
|
|
12167
|
+
};
|
|
12168
|
+
}
|
|
12057
12169
|
function resolveMemberExchangeUrl() {
|
|
12058
12170
|
const explicit = process.env.ZANFIA_MEMBER_EXCHANGE_URL ?? backendDefaults.memberExchangeUrl;
|
|
12059
12171
|
if (explicit) return explicit;
|
|
@@ -12098,14 +12210,16 @@ async function runMemberLogin(options) {
|
|
|
12098
12210
|
const host = safeHostname();
|
|
12099
12211
|
const server = await startLoopbackServer();
|
|
12100
12212
|
const redirectUri = `http://127.0.0.1:${server.port}${CALLBACK_PATH}`;
|
|
12101
|
-
const url = buildConsentUrl(
|
|
12102
|
-
|
|
12103
|
-
|
|
12104
|
-
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
|
|
12108
|
-
|
|
12213
|
+
const url = buildConsentUrl(
|
|
12214
|
+
consentUrl,
|
|
12215
|
+
buildMemberConsentParams({
|
|
12216
|
+
redirectUri,
|
|
12217
|
+
state,
|
|
12218
|
+
challenge,
|
|
12219
|
+
hostname: host,
|
|
12220
|
+
readOnly: options.readOnly
|
|
12221
|
+
})
|
|
12222
|
+
);
|
|
12109
12223
|
process.stdout.write(`Opening ${url}
|
|
12110
12224
|
`);
|
|
12111
12225
|
process.stdout.write("Waiting for browser callback...\n\n");
|
|
@@ -12131,6 +12245,8 @@ async function runMemberLogin(options) {
|
|
|
12131
12245
|
workspaceName: exchanged.workspaceName
|
|
12132
12246
|
});
|
|
12133
12247
|
process.stdout.write(`Logged in as ${exchanged.userEmail} (community member).
|
|
12248
|
+
`);
|
|
12249
|
+
process.stdout.write(`Access: ${memberScopeLabel(decodeTokenClaims(exchanged.token))}
|
|
12134
12250
|
`);
|
|
12135
12251
|
process.stdout.write(`Workspace: ${exchanged.workspaceName} (${exchanged.workspaceId})
|
|
12136
12252
|
`);
|
|
@@ -12162,6 +12278,9 @@ function registerLoginCommand(auth) {
|
|
|
12162
12278
|
).option(
|
|
12163
12279
|
"--address <url>",
|
|
12164
12280
|
"sign in as a community member (Community API) against this creator platform URL"
|
|
12281
|
+
).option(
|
|
12282
|
+
"--read-only",
|
|
12283
|
+
"member login only: the key can read the communities but never post, comment or chat"
|
|
12165
12284
|
).option("-v, --verbose", "show HTTP request details").addHelpText(
|
|
12166
12285
|
"after",
|
|
12167
12286
|
`
|
|
@@ -12177,24 +12296,33 @@ The two flows use different consent pages:
|
|
|
12177
12296
|
command uses another stored login just for that command.
|
|
12178
12297
|
|
|
12179
12298
|
Community member login \u2014 Community API only:
|
|
12180
|
-
login --address https://<creator-platform-url>
|
|
12299
|
+
login --address https://<creator-platform-url> [--read-only]
|
|
12181
12300
|
Opens the consent page on that creator's platform (where you log in as
|
|
12182
12301
|
their customer). The CLI gets a member token scoped to that workspace's
|
|
12183
12302
|
communities; the community URL is passed as the platform address, and
|
|
12184
|
-
which community to act in is chosen per command.
|
|
12303
|
+
which community to act in is chosen per command. --read-only gets a key
|
|
12304
|
+
that can read and summarize but never post, comment or chat (the right
|
|
12305
|
+
choice for an agent that only reads); \`auth status\` shows the scope.
|
|
12185
12306
|
|
|
12186
12307
|
No browser? Generate a key on the creator's platform under
|
|
12187
|
-
Settings ->
|
|
12308
|
+
Settings -> AI agents and paste the shown "auth set-key"
|
|
12309
|
+
command instead.
|
|
12188
12310
|
`
|
|
12189
12311
|
).action(async (options) => {
|
|
12190
12312
|
if (options.address) {
|
|
12191
12313
|
await runMemberLogin({
|
|
12192
12314
|
address: options.address,
|
|
12193
12315
|
apiUrl: options.apiUrl,
|
|
12194
|
-
verbose: options.verbose
|
|
12316
|
+
verbose: options.verbose,
|
|
12317
|
+
readOnly: options.readOnly
|
|
12195
12318
|
});
|
|
12196
12319
|
return;
|
|
12197
12320
|
}
|
|
12321
|
+
if (options.readOnly) {
|
|
12322
|
+
throw new Error(
|
|
12323
|
+
"--read-only applies to community member logins: add --address <creator-platform-url> (or use `zanfia join <handle> --read-only`)."
|
|
12324
|
+
);
|
|
12325
|
+
}
|
|
12198
12326
|
await runLogin(options);
|
|
12199
12327
|
});
|
|
12200
12328
|
}
|
|
@@ -13105,10 +13233,10 @@ function registerCampaignsCommands(program2) {
|
|
|
13105
13233
|
});
|
|
13106
13234
|
});
|
|
13107
13235
|
campaigns.command("test").description(
|
|
13108
|
-
"Send a TEST of the saved campaign to
|
|
13236
|
+
"Send a TEST of the saved campaign to your team's addresses only (default: your own) \u2014 subject prefixed [Test], sample personalization values; never the audience"
|
|
13109
13237
|
).argument("<id>", "campaign id").option(
|
|
13110
13238
|
"--to <email>",
|
|
13111
|
-
"test recipient
|
|
13239
|
+
"test recipient: a team member account e-mail (or a mail-tester.com inbox), repeatable or comma-separated, max 3 (default: your own address)",
|
|
13112
13240
|
collectRepeatable,
|
|
13113
13241
|
[]
|
|
13114
13242
|
).action(async (id, options, command) => {
|
|
@@ -19900,7 +20028,13 @@ async function runJoin(handleInput, options) {
|
|
|
19900
20028
|
completed = await postJson2(
|
|
19901
20029
|
"Join",
|
|
19902
20030
|
joinUrl(communityApiUrl, handle, "complete"),
|
|
19903
|
-
{
|
|
20031
|
+
{
|
|
20032
|
+
email,
|
|
20033
|
+
code,
|
|
20034
|
+
firstName,
|
|
20035
|
+
hostname: hostname3,
|
|
20036
|
+
...options.readOnly ? { readOnly: true } : {}
|
|
20037
|
+
},
|
|
19904
20038
|
{ verbose }
|
|
19905
20039
|
);
|
|
19906
20040
|
} catch (err) {
|
|
@@ -19923,11 +20057,14 @@ async function runJoin(handleInput, options) {
|
|
|
19923
20057
|
workspaceName: completed.workspaceName,
|
|
19924
20058
|
kind: "member"
|
|
19925
20059
|
});
|
|
20060
|
+
const claims = decodeTokenClaims(completed.token);
|
|
20061
|
+
const readOnly = isReadOnlyMemberKey(claims);
|
|
19926
20062
|
if (options.json) {
|
|
19927
20063
|
process.stdout.write(
|
|
19928
20064
|
`${JSON.stringify(
|
|
19929
20065
|
{
|
|
19930
20066
|
joined: true,
|
|
20067
|
+
readOnly,
|
|
19931
20068
|
alreadyMember: completed.alreadyMember,
|
|
19932
20069
|
communityId: completed.communityId,
|
|
19933
20070
|
communityName: completed.communityName,
|
|
@@ -19945,12 +20082,13 @@ async function runJoin(handleInput, options) {
|
|
|
19945
20082
|
);
|
|
19946
20083
|
return;
|
|
19947
20084
|
}
|
|
19948
|
-
const intro = completed.introChannelId ? ` zanfia communities post create ${completed.communityId} ${completed.introChannelId} --content "Hi, I'm <your agent>. I ..."
|
|
20085
|
+
const intro = completed.introChannelId && !readOnly ? ` zanfia communities post create ${completed.communityId} ${completed.introChannelId} --content "Hi, I'm <your agent>. I ..."
|
|
19949
20086
|
` : "";
|
|
19950
20087
|
process.stdout.write(
|
|
19951
20088
|
`
|
|
19952
20089
|
${completed.alreadyMember ? "Welcome back to" : "You are in:"} ${completed.communityName}.
|
|
19953
20090
|
Member key saved to ${path2} (expires ${completed.expiresAt.slice(0, 10)}).
|
|
20091
|
+
Access: ${memberScopeLabel(claims)}
|
|
19954
20092
|
|
|
19955
20093
|
Next:
|
|
19956
20094
|
zanfia communities list
|
|
@@ -19963,17 +20101,20 @@ Plug in your agent: ${AGENT_DOCS_URL}
|
|
|
19963
20101
|
);
|
|
19964
20102
|
}
|
|
19965
20103
|
function registerJoinCommand(program2) {
|
|
19966
|
-
program2.command("join <handle>").description("Join a public community from the terminal (emailed code) and get a member key").option("--email <email>", "email to join with (prompted when omitted)").option("--name <name>", "your display name (prompted when omitted)").option("--code <code>", "the 6-digit code from the email (prompted when omitted)").addHelpText(
|
|
20104
|
+
program2.command("join <handle>").description("Join a public community from the terminal (emailed code) and get a member key").option("--email <email>", "email to join with (prompted when omitted)").option("--name <name>", "your display name (prompted when omitted)").option("--code <code>", "the 6-digit code from the email (prompted when omitted)").option("--read-only", "get a key that can read and summarize but never post, comment or chat").addHelpText(
|
|
19967
20105
|
"after",
|
|
19968
20106
|
`
|
|
19969
20107
|
Examples:
|
|
19970
20108
|
zanfia join crew-of-one
|
|
19971
20109
|
zanfia join crew-of-one --email me@example.com --name "Sam" --code 123456
|
|
20110
|
+
zanfia join crew-of-one --read-only
|
|
19972
20111
|
|
|
19973
20112
|
The key is a MEMBER key: it reaches the Community API for that creator's
|
|
19974
|
-
communities only (read/post/comment/chat), never your own workspace.
|
|
19975
|
-
|
|
19976
|
-
|
|
20113
|
+
communities only (read/post/comment/chat), never your own workspace. With
|
|
20114
|
+
--read-only it can only read (the right choice for an agent that reads and
|
|
20115
|
+
summarizes); \`zanfia auth status\` shows the scope. It is saved to
|
|
20116
|
+
~/.config/zanfia/credentials.json and expires in 90 days \u2014 run join again
|
|
20117
|
+
to refresh it.
|
|
19977
20118
|
`
|
|
19978
20119
|
).action(async (handle, options, command) => {
|
|
19979
20120
|
const globals = getGlobalFlags(command);
|
|
@@ -20100,7 +20241,7 @@ import { basename } from "path";
|
|
|
20100
20241
|
import { createReadStream as createReadStream2 } from "fs";
|
|
20101
20242
|
import { stat as stat2 } from "fs/promises";
|
|
20102
20243
|
|
|
20103
|
-
//
|
|
20244
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/error.js
|
|
20104
20245
|
function _typeof(o) {
|
|
20105
20246
|
"@babel/helpers - typeof";
|
|
20106
20247
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
@@ -20254,14 +20395,14 @@ var DetailedError = /* @__PURE__ */ (function(_Error) {
|
|
|
20254
20395
|
})(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
20255
20396
|
var error_default = DetailedError;
|
|
20256
20397
|
|
|
20257
|
-
//
|
|
20398
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/logger.js
|
|
20258
20399
|
var isEnabled = false;
|
|
20259
20400
|
function log(msg) {
|
|
20260
20401
|
if (!isEnabled) return;
|
|
20261
20402
|
console.log(msg);
|
|
20262
20403
|
}
|
|
20263
20404
|
|
|
20264
|
-
//
|
|
20405
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/noopUrlStorage.js
|
|
20265
20406
|
function _typeof2(o) {
|
|
20266
20407
|
"@babel/helpers - typeof";
|
|
20267
20408
|
return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
@@ -20331,7 +20472,7 @@ var NoopUrlStorage = /* @__PURE__ */ (function() {
|
|
|
20331
20472
|
}]);
|
|
20332
20473
|
})();
|
|
20333
20474
|
|
|
20334
|
-
//
|
|
20475
|
+
// ../../../Zanfia2/node_modules/tus-js-client/node_modules/js-base64/base64.mjs
|
|
20335
20476
|
var version = "3.7.8";
|
|
20336
20477
|
var VERSION = version;
|
|
20337
20478
|
var _hasBuffer = typeof Buffer === "function";
|
|
@@ -20493,10 +20634,10 @@ var gBase64 = {
|
|
|
20493
20634
|
extendBuiltins
|
|
20494
20635
|
};
|
|
20495
20636
|
|
|
20496
|
-
//
|
|
20637
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/upload.js
|
|
20497
20638
|
var import_url_parse = __toESM(require_url_parse());
|
|
20498
20639
|
|
|
20499
|
-
//
|
|
20640
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/uuid.js
|
|
20500
20641
|
function uuid() {
|
|
20501
20642
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
20502
20643
|
var r = Math.random() * 16 | 0;
|
|
@@ -20505,7 +20646,7 @@ function uuid() {
|
|
|
20505
20646
|
});
|
|
20506
20647
|
}
|
|
20507
20648
|
|
|
20508
|
-
//
|
|
20649
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/upload.js
|
|
20509
20650
|
function _regeneratorRuntime() {
|
|
20510
20651
|
"use strict";
|
|
20511
20652
|
_regeneratorRuntime = function _regeneratorRuntime4() {
|
|
@@ -21740,11 +21881,11 @@ function splitSizeIntoParts(totalSize, partCount) {
|
|
|
21740
21881
|
BaseUpload.defaultOptions = defaultOptions;
|
|
21741
21882
|
var upload_default = BaseUpload;
|
|
21742
21883
|
|
|
21743
|
-
//
|
|
21884
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/node/fileReader.js
|
|
21744
21885
|
var import_is_stream = __toESM(require_is_stream());
|
|
21745
21886
|
import { ReadStream } from "fs";
|
|
21746
21887
|
|
|
21747
|
-
//
|
|
21888
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/node/sources/BufferSource.js
|
|
21748
21889
|
function _typeof4(o) {
|
|
21749
21890
|
"@babel/helpers - typeof";
|
|
21750
21891
|
return _typeof4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
@@ -21811,7 +21952,7 @@ var BufferSource = /* @__PURE__ */ (function() {
|
|
|
21811
21952
|
}]);
|
|
21812
21953
|
})();
|
|
21813
21954
|
|
|
21814
|
-
//
|
|
21955
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/node/sources/FileSource.js
|
|
21815
21956
|
import { createReadStream, promises as fsPromises } from "fs";
|
|
21816
21957
|
function _typeof5(o) {
|
|
21817
21958
|
"@babel/helpers - typeof";
|
|
@@ -22187,7 +22328,7 @@ var FileSource = /* @__PURE__ */ (function() {
|
|
|
22187
22328
|
}]);
|
|
22188
22329
|
})();
|
|
22189
22330
|
|
|
22190
|
-
//
|
|
22331
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/node/sources/StreamSource.js
|
|
22191
22332
|
function _typeof6(o) {
|
|
22192
22333
|
"@babel/helpers - typeof";
|
|
22193
22334
|
return _typeof6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
@@ -22627,7 +22768,7 @@ var StreamSource = /* @__PURE__ */ (function() {
|
|
|
22627
22768
|
}]);
|
|
22628
22769
|
})();
|
|
22629
22770
|
|
|
22630
|
-
//
|
|
22771
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/node/fileReader.js
|
|
22631
22772
|
function _typeof7(o) {
|
|
22632
22773
|
"@babel/helpers - typeof";
|
|
22633
22774
|
return _typeof7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
@@ -22695,7 +22836,7 @@ var FileReader = /* @__PURE__ */ (function() {
|
|
|
22695
22836
|
}]);
|
|
22696
22837
|
})();
|
|
22697
22838
|
|
|
22698
|
-
//
|
|
22839
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/node/fileSignature.js
|
|
22699
22840
|
import { createHash as createHash3 } from "crypto";
|
|
22700
22841
|
import * as fs from "fs";
|
|
22701
22842
|
import * as path from "path";
|
|
@@ -22723,7 +22864,7 @@ function fingerprint(file, options) {
|
|
|
22723
22864
|
return Promise.resolve(null);
|
|
22724
22865
|
}
|
|
22725
22866
|
|
|
22726
|
-
//
|
|
22867
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/node/httpStack.js
|
|
22727
22868
|
var import_lodash = __toESM(require_lodash());
|
|
22728
22869
|
import * as http from "http";
|
|
22729
22870
|
import * as https from "https";
|
|
@@ -23027,11 +23168,11 @@ var writeBufferToStreamWithProgress = function writeBufferToStreamWithProgress2(
|
|
|
23027
23168
|
writeNextChunk();
|
|
23028
23169
|
};
|
|
23029
23170
|
|
|
23030
|
-
//
|
|
23171
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/node/urlStorage.js
|
|
23031
23172
|
var import_combine_errors = __toESM(require_combine_errors());
|
|
23032
23173
|
var lockfile = __toESM(require_proper_lockfile());
|
|
23033
23174
|
|
|
23034
|
-
//
|
|
23175
|
+
// ../../../Zanfia2/node_modules/tus-js-client/lib.esm/node/index.js
|
|
23035
23176
|
function _typeof9(o) {
|
|
23036
23177
|
"@babel/helpers - typeof";
|
|
23037
23178
|
return _typeof9 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
@@ -25698,7 +25839,10 @@ function registerPagesCommands(program2) {
|
|
|
25698
25839
|
});
|
|
25699
25840
|
pages.command("generate").description(
|
|
25700
25841
|
"AI-generate a hosted DRAFT page from a brief. Consumes AI credits and runs in the background (202 + run id, ~1-5 minutes) \u2014 the page appears in `pages list` when the run finishes. Signup intents (lead-magnet / webinar / waitlist) also provision a signup form, a companion thank-you page and a DRAFT delivery automation. Facts in the brief (price, date, links) are used verbatim. Requires --confirm."
|
|
25701
|
-
).requiredOption("--intent <intent>", `what the page is for (${PAGE_INTENTS.join(" | ")})`).requiredOption("--title <title>", "page title (the slug derives from it unless --slug)").requiredOption("--brief <textOrFile>", "the brief \u2014 inline text or a path to a text file").option("--template <templateId>", "design-template seed from `pages templates`").option("--product <productId>", "grounding product (real name/prices + checkout link)").option("--checkout <checkoutId>", "override the product's default checkout as the offer").option(
|
|
25842
|
+
).requiredOption("--intent <intent>", `what the page is for (${PAGE_INTENTS.join(" | ")})`).requiredOption("--title <title>", "page title (the slug derives from it unless --slug)").requiredOption("--brief <textOrFile>", "the brief \u2014 inline text or a path to a text file").option("--template <templateId>", "design-template seed from `pages templates`").option("--product <productId>", "grounding product (real name/prices + checkout link)").option("--checkout <checkoutId>", "override the product's default checkout as the offer").option(
|
|
25843
|
+
"--form <formId>",
|
|
25844
|
+
"standalone signup form the page renders natively as its signup section (never an iframe)"
|
|
25845
|
+
).option("--source-url <url>", "website to start from (fetched server-side; beats --template)").option(
|
|
25702
25846
|
"--source-mode <mode>",
|
|
25703
25847
|
`how the source site is used, required with --source-url (${SOURCE_SITE_MODES.join(" | ")})`
|
|
25704
25848
|
).option("--slug <slug>", "public URL slug; derived from the title when omitted").option(
|
|
@@ -30763,8 +30907,8 @@ function applyShortHelp(program2) {
|
|
|
30763
30907
|
|
|
30764
30908
|
// src/program.ts
|
|
30765
30909
|
function resolveCliVersion() {
|
|
30766
|
-
if ("0.
|
|
30767
|
-
return "0.
|
|
30910
|
+
if ("0.13.1".length > 0) {
|
|
30911
|
+
return "0.13.1";
|
|
30768
30912
|
}
|
|
30769
30913
|
try {
|
|
30770
30914
|
const raw = readFileSync28(new URL("../package.json", import.meta.url), "utf8");
|
|
@@ -30791,13 +30935,14 @@ Signing in \u2014 two roles, two consent pages:
|
|
|
30791
30935
|
${programName} login
|
|
30792
30936
|
Creator (workspace) login. Opens the consent page in the Zanfia dashboard.
|
|
30793
30937
|
Grants the full Workspace API: products, clients, orders, stats, \u2026
|
|
30794
|
-
${programName} login --address https://<creator-platform-url>
|
|
30938
|
+
${programName} login --address https://<creator-platform-url> [--read-only]
|
|
30795
30939
|
Community member login. Opens the consent page on that creator's platform.
|
|
30796
|
-
Grants the Community API only: communities, posts, comments.
|
|
30940
|
+
Grants the Community API only: communities, posts, comments. --read-only
|
|
30941
|
+
gets a key that reads and summarizes but never posts.
|
|
30797
30942
|
${programName} auth set-key --api-url <api-community-url> <key>
|
|
30798
30943
|
Member alternative without a browser: paste the key generated on the
|
|
30799
|
-
creator's platform under Settings \u2192
|
|
30800
|
-
${programName} join <handle>
|
|
30944
|
+
creator's platform under Settings \u2192 AI agents.
|
|
30945
|
+
${programName} join <handle> [--read-only]
|
|
30801
30946
|
Join a public community from the terminal: emailed 6-digit code, then a
|
|
30802
30947
|
member key is saved \u2014 no account or browser needed. Try: join crew-of-one
|
|
30803
30948
|
`
|