@pmate/cli 0.49.2 → 0.49.3
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/index.d.ts +0 -16
- package/dist/index.js +20 -109
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -544,7 +544,6 @@ type OrgCommandArgs = {
|
|
|
544
544
|
action: "create";
|
|
545
545
|
orgId: string;
|
|
546
546
|
displayName: string;
|
|
547
|
-
members: string[];
|
|
548
547
|
baseUrl?: string;
|
|
549
548
|
json: boolean;
|
|
550
549
|
} | {
|
|
@@ -560,21 +559,6 @@ type OrgCommandArgs = {
|
|
|
560
559
|
orgId: string;
|
|
561
560
|
baseUrl?: string;
|
|
562
561
|
json: boolean;
|
|
563
|
-
} | {
|
|
564
|
-
type: Command.Org;
|
|
565
|
-
action: "member-add" | "member-remove";
|
|
566
|
-
orgId: string;
|
|
567
|
-
account: string;
|
|
568
|
-
baseUrl?: string;
|
|
569
|
-
json: boolean;
|
|
570
|
-
} | {
|
|
571
|
-
type: Command.Org;
|
|
572
|
-
action: "member-set";
|
|
573
|
-
orgId: string;
|
|
574
|
-
accounts?: string[];
|
|
575
|
-
filePath?: string;
|
|
576
|
-
baseUrl?: string;
|
|
577
|
-
json: boolean;
|
|
578
562
|
} | {
|
|
579
563
|
type: Command.Org;
|
|
580
564
|
action: "visible-app-list";
|
package/dist/index.js
CHANGED
|
@@ -24051,10 +24051,9 @@ var OrgCommandHandler = class {
|
|
|
24051
24051
|
case "create": {
|
|
24052
24052
|
const record = await this.request(baseUrl2, token, "POST", "/orgs", {
|
|
24053
24053
|
id: args.orgId,
|
|
24054
|
-
displayName: args.displayName
|
|
24055
|
-
members: args.members
|
|
24054
|
+
displayName: args.displayName
|
|
24056
24055
|
});
|
|
24057
|
-
ui.success(`Created
|
|
24056
|
+
ui.success(`Created registry metadata ${record.id}; Merry Team membership is not initialized`);
|
|
24058
24057
|
this.renderJson(record, args.json);
|
|
24059
24058
|
return;
|
|
24060
24059
|
}
|
|
@@ -24090,42 +24089,8 @@ var OrgCommandHandler = class {
|
|
|
24090
24089
|
"GET",
|
|
24091
24090
|
`/orgs/${encodeURIComponent(args.orgId)}/members`
|
|
24092
24091
|
);
|
|
24093
|
-
|
|
24094
|
-
|
|
24095
|
-
}
|
|
24096
|
-
case "member-add": {
|
|
24097
|
-
const record = await this.request(
|
|
24098
|
-
baseUrl2,
|
|
24099
|
-
token,
|
|
24100
|
-
"PUT",
|
|
24101
|
-
`/orgs/${encodeURIComponent(args.orgId)}/members/${encodeURIComponent(args.account)}`
|
|
24102
|
-
);
|
|
24103
|
-
ui.success(`Added ${args.account} to ${record.id}`);
|
|
24104
|
-
this.renderJson(record, args.json);
|
|
24105
|
-
return;
|
|
24106
|
-
}
|
|
24107
|
-
case "member-remove": {
|
|
24108
|
-
const record = await this.request(
|
|
24109
|
-
baseUrl2,
|
|
24110
|
-
token,
|
|
24111
|
-
"DELETE",
|
|
24112
|
-
`/orgs/${encodeURIComponent(args.orgId)}/members/${encodeURIComponent(args.account)}`
|
|
24113
|
-
);
|
|
24114
|
-
ui.success(`Removed ${args.account} from ${record.id}`);
|
|
24115
|
-
this.renderJson(record, args.json);
|
|
24116
|
-
return;
|
|
24117
|
-
}
|
|
24118
|
-
case "member-set": {
|
|
24119
|
-
const accounts = this.resolveStringArrayInput(args.accounts, args.filePath, "account");
|
|
24120
|
-
const record = await this.request(
|
|
24121
|
-
baseUrl2,
|
|
24122
|
-
token,
|
|
24123
|
-
"PUT",
|
|
24124
|
-
`/orgs/${encodeURIComponent(args.orgId)}/members`,
|
|
24125
|
-
accounts
|
|
24126
|
-
);
|
|
24127
|
-
ui.success(`Updated members for ${record.id}`);
|
|
24128
|
-
this.renderJson(record, args.json);
|
|
24092
|
+
if (!args.json) ui.warn("Legacy Factory roster only; this is not Merry Social V2 membership.");
|
|
24093
|
+
this.renderStringList(result.items, args.json, "No legacy Factory members found.");
|
|
24129
24094
|
return;
|
|
24130
24095
|
}
|
|
24131
24096
|
case "visible-app-list": {
|
|
@@ -24175,6 +24140,8 @@ var OrgCommandHandler = class {
|
|
|
24175
24140
|
this.renderJson(result.items, args.json);
|
|
24176
24141
|
return;
|
|
24177
24142
|
}
|
|
24143
|
+
default:
|
|
24144
|
+
throw new Error("Unsupported org action. Legacy member writes were removed; use Hub Social V2.");
|
|
24178
24145
|
}
|
|
24179
24146
|
}
|
|
24180
24147
|
resolveBaseUrl(baseUrl2) {
|
|
@@ -26778,7 +26745,6 @@ function parseOrgArgs(tokens) {
|
|
|
26778
26745
|
if (action === "create") {
|
|
26779
26746
|
const orgId = parseRequiredOrgRef(rest.shift(), action);
|
|
26780
26747
|
let displayName;
|
|
26781
|
-
const members = [];
|
|
26782
26748
|
while (rest.length > 0) {
|
|
26783
26749
|
const token = rest.shift();
|
|
26784
26750
|
switch (token) {
|
|
@@ -26786,8 +26752,7 @@ function parseOrgArgs(tokens) {
|
|
|
26786
26752
|
displayName = requireValue6(rest, token);
|
|
26787
26753
|
break;
|
|
26788
26754
|
case "--member":
|
|
26789
|
-
|
|
26790
|
-
break;
|
|
26755
|
+
throw new Error("org create --member was removed. Merry membership is managed through Hub Social V2; org create only creates registry metadata.");
|
|
26791
26756
|
case "--base-url":
|
|
26792
26757
|
baseUrl2 = requireValue6(rest, token);
|
|
26793
26758
|
break;
|
|
@@ -26800,7 +26765,7 @@ function parseOrgArgs(tokens) {
|
|
|
26800
26765
|
}
|
|
26801
26766
|
if (!displayName) {
|
|
26802
26767
|
throw new Error(
|
|
26803
|
-
"Usage: org create <ns:org> --display-name <name> [--
|
|
26768
|
+
"Usage: org create <ns:org> --display-name <name> [--base-url <url>] [--json]"
|
|
26804
26769
|
);
|
|
26805
26770
|
}
|
|
26806
26771
|
return {
|
|
@@ -26808,7 +26773,6 @@ function parseOrgArgs(tokens) {
|
|
|
26808
26773
|
action,
|
|
26809
26774
|
orgId,
|
|
26810
26775
|
displayName,
|
|
26811
|
-
members,
|
|
26812
26776
|
baseUrl: baseUrl2,
|
|
26813
26777
|
json
|
|
26814
26778
|
};
|
|
@@ -26856,69 +26820,19 @@ function parseOrgArgs(tokens) {
|
|
|
26856
26820
|
function parseOrgMemberArgs(memberTokens) {
|
|
26857
26821
|
const subAction = memberTokens.shift();
|
|
26858
26822
|
if (!subAction) {
|
|
26859
|
-
throw new Error("Missing org member action. Use: org member list
|
|
26823
|
+
throw new Error("Missing org member action. Use: org member list (legacy Factory roster only)");
|
|
26860
26824
|
}
|
|
26861
|
-
|
|
26862
|
-
|
|
26863
|
-
|
|
26864
|
-
|
|
26825
|
+
if (subAction !== "list") {
|
|
26826
|
+
throw new Error("org member writes were removed. Use Hub /api/social/member-roles with a Team Admin session; verify /api/social/teams and /api/social/members. New Teams require controlled Social V2 initialization.");
|
|
26827
|
+
}
|
|
26828
|
+
const orgId = parseRequiredOrgRef(memberTokens.shift(), "member list");
|
|
26865
26829
|
while (memberTokens.length > 0) {
|
|
26866
26830
|
const token = memberTokens.shift();
|
|
26867
|
-
|
|
26868
|
-
|
|
26869
|
-
|
|
26870
|
-
account = value;
|
|
26871
|
-
accounts.push(value);
|
|
26872
|
-
break;
|
|
26873
|
-
}
|
|
26874
|
-
case "--file":
|
|
26875
|
-
filePath = requireValue6(memberTokens, token);
|
|
26876
|
-
break;
|
|
26877
|
-
case "--base-url":
|
|
26878
|
-
baseUrl2 = requireValue6(memberTokens, token);
|
|
26879
|
-
break;
|
|
26880
|
-
case "--json":
|
|
26881
|
-
json = true;
|
|
26882
|
-
break;
|
|
26883
|
-
default:
|
|
26884
|
-
throw new Error(`Unknown org member option: ${token}`);
|
|
26885
|
-
}
|
|
26886
|
-
}
|
|
26887
|
-
if (subAction === "list") {
|
|
26888
|
-
return { type: "org" /* Org */, action: "member-list", orgId, baseUrl: baseUrl2, json };
|
|
26889
|
-
}
|
|
26890
|
-
if (subAction === "add" || subAction === "remove") {
|
|
26891
|
-
if (!account) {
|
|
26892
|
-
throw new Error(
|
|
26893
|
-
`Usage: org member ${subAction} <ns:org> --account <id> [--base-url <url>] [--json]`
|
|
26894
|
-
);
|
|
26895
|
-
}
|
|
26896
|
-
return {
|
|
26897
|
-
type: "org" /* Org */,
|
|
26898
|
-
action: subAction === "add" ? "member-add" : "member-remove",
|
|
26899
|
-
orgId,
|
|
26900
|
-
account,
|
|
26901
|
-
baseUrl: baseUrl2,
|
|
26902
|
-
json
|
|
26903
|
-
};
|
|
26904
|
-
}
|
|
26905
|
-
if (subAction === "set") {
|
|
26906
|
-
if (accounts.length === 0 && !filePath || accounts.length > 0 && filePath) {
|
|
26907
|
-
throw new Error(
|
|
26908
|
-
"Usage: org member set <ns:org> (--account <id> ... | --file <path>) [--base-url <url>] [--json]"
|
|
26909
|
-
);
|
|
26910
|
-
}
|
|
26911
|
-
return {
|
|
26912
|
-
type: "org" /* Org */,
|
|
26913
|
-
action: "member-set",
|
|
26914
|
-
orgId,
|
|
26915
|
-
accounts: accounts.length > 0 ? accounts : void 0,
|
|
26916
|
-
filePath,
|
|
26917
|
-
baseUrl: baseUrl2,
|
|
26918
|
-
json
|
|
26919
|
-
};
|
|
26831
|
+
if (token === "--base-url") baseUrl2 = requireValue6(memberTokens, token);
|
|
26832
|
+
else if (token === "--json") json = true;
|
|
26833
|
+
else throw new Error(`Unknown org member list option: ${token}`);
|
|
26920
26834
|
}
|
|
26921
|
-
|
|
26835
|
+
return { type: "org" /* Org */, action: "member-list", orgId, baseUrl: baseUrl2, json };
|
|
26922
26836
|
}
|
|
26923
26837
|
function parseOrgVisibleAppArgs(visibleTokens) {
|
|
26924
26838
|
const subAction = visibleTokens.shift();
|
|
@@ -27628,16 +27542,13 @@ var HELP_TEXT = [
|
|
|
27628
27542
|
` ${import_chalk4.default.gray(" access-key disable <id> [--base-url <url>] [--json]")}`,
|
|
27629
27543
|
` ${import_chalk4.default.gray(" access-key login --app <ns:app> (--key <secret> | --key-file <path>) [--base-url <url>] [--json]")}`,
|
|
27630
27544
|
` ${import_chalk4.default.gray(" default base URL: https://auth-api-v2.pmate.chat")}`,
|
|
27631
|
-
` ${import_chalk4.default.cyan("org")} Manage
|
|
27545
|
+
` ${import_chalk4.default.cyan("org")} Manage registry metadata and Factory app distribution (not Merry membership)`,
|
|
27632
27546
|
` ${import_chalk4.default.gray(" list [--base-url <url>] [--json]")}`,
|
|
27633
27547
|
` ${import_chalk4.default.gray(" get <ns:org> [--base-url <url>] [--json]")}`,
|
|
27634
|
-
` ${import_chalk4.default.gray(" create <ns:org> --display-name <name> [--
|
|
27548
|
+
` ${import_chalk4.default.gray(" create <ns:org> --display-name <name> [--base-url <url>] [--json]")}`,
|
|
27635
27549
|
` ${import_chalk4.default.gray(" update <ns:org> --display-name <name> [--base-url <url>] [--json]")}`,
|
|
27636
27550
|
` ${import_chalk4.default.gray(" disable <ns:org> [--base-url <url>] [--json]")}`,
|
|
27637
|
-
` ${import_chalk4.default.gray(" member list <ns:org> [--base-url <url>] [--json]")}`,
|
|
27638
|
-
` ${import_chalk4.default.gray(" member add <ns:org> --account <id> [--base-url <url>] [--json]")}`,
|
|
27639
|
-
` ${import_chalk4.default.gray(" member remove <ns:org> --account <id> [--base-url <url>] [--json]")}`,
|
|
27640
|
-
` ${import_chalk4.default.gray(" member set <ns:org> (--account <id> ... | --file <path>) [--base-url <url>] [--json]")}`,
|
|
27551
|
+
` ${import_chalk4.default.gray(" member list <ns:org> [--base-url <url>] [--json] (legacy Factory roster only)")}`,
|
|
27641
27552
|
` ${import_chalk4.default.gray(" visible-app list <ns:org> [--base-url <url>] [--json]")}`,
|
|
27642
27553
|
` ${import_chalk4.default.gray(" visible-app add <ns:org> --app <ns:app> [--base-url <url>] [--json]")}`,
|
|
27643
27554
|
` ${import_chalk4.default.gray(" visible-app remove <ns:org> --app <ns:app> [--base-url <url>] [--json]")}`,
|