@go-labs-sg/rsvp 0.5.0 → 0.6.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.
Files changed (3) hide show
  1. package/README.md +23 -0
  2. package/dist/index.js +43 -10
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -61,6 +61,10 @@ Global administrators can update another account's global role from the web user
61
61
 
62
62
  ## Command safety
63
63
 
64
+ Argument-parsing errors use a safe command label and never echo option values,
65
+ including roster JSON passed through `--payload`. Surrounding shell history and
66
+ automation can still record arguments independently of the CLI's error output.
67
+
64
68
  Use `rsvp help` for the command catalogue. Every response is a JSON envelope on stdout; errors and diagnostics go to stderr. `rsvp manifest` emits the machine-readable command reference for tooling.
65
69
 
66
70
  For a read-only registration-journey diagnosis, inspect the event, draft,
@@ -73,6 +77,25 @@ rsvp event flow versions list --organization-id org_123 --event-id evt_123
73
77
  rsvp event flow resources get --organization-id org_123 --event-id evt_123
74
78
  ```
75
79
 
80
+ Create an immutable menu version with an explicit mutation acknowledgement. The
81
+ target is the event ID in the payload:
82
+
83
+ ```sh
84
+ rsvp event flow menu version create \
85
+ --allow-state-change \
86
+ --target evt_123 \
87
+ --payload '{"organizationId":"org_123","eventId":"evt_123","menu":{"mode":"NEW","key":"dinner","name":"Dinner"},"choices":[{"key":"standard","label":"Standard meal","dietaryTags":[]}]}'
88
+ ```
89
+
90
+ To version an existing menu, use `"menu":{"mode":"EXISTING","menuId":"..."}`
91
+ in the payload and keep the event ID as `--target`.
92
+
93
+ Reference the returned `version.id` from the draft's `MENU_SELECTION` blocks,
94
+ then save with `event flow draft save`, `--allow-state-change`, and the event ID
95
+ as `--target`. Include the latest draft revision as `expectedRevision`; nested
96
+ resource IDs such as a seating block's `seatMapId` are not approval targets for
97
+ this command. Saving the draft does not publish the registration flow.
98
+
76
99
  Commands returning invitee, registration, roster, report, audit, export, payment, or user data require `--ack-sensitive-data`. Mutations require their exact effect gates and a `--target` matching the affected resource in the payload. Depending on the operation, gates include:
77
100
 
78
101
  - `--allow-state-change`
package/dist/index.js CHANGED
@@ -19216,10 +19216,18 @@ var commands = {
19216
19216
  scope: "event",
19217
19217
  summary: "List the menus, consent documents, images, and seat maps available to the registration flow."
19218
19218
  },
19219
+ "event flow menu version create": {
19220
+ effects: ["state-change"],
19221
+ operation: (api2, input2) => api2.eventFlow.createMenuVersion.mutate(input2),
19222
+ payloadOnly: true,
19223
+ targetKey: "eventId",
19224
+ summary: "Create an immutable event menu version (--payload JSON)."
19225
+ },
19219
19226
  "event flow draft save": {
19220
19227
  effects: ["state-change"],
19221
19228
  operation: (api2, input2) => api2.eventFlow.saveDraft.mutate(input2),
19222
19229
  payloadOnly: true,
19230
+ targetKey: "eventId",
19223
19231
  summary: "Save a revision-checked registration flow draft (--payload JSON)."
19224
19232
  },
19225
19233
  "event flow published get": {
@@ -19759,15 +19767,27 @@ var collectValuesForKey = (value, targetKey) => {
19759
19767
  return collectValuesForKey(nested, targetKey);
19760
19768
  });
19761
19769
  };
19762
- var collectTargets = (input2) => {
19763
- for (const targetKey of targetKeys) {
19764
- const values = collectValuesForKey(input2, targetKey);
19770
+ var collectDirectTargetValues = (input2, targetKey) => {
19771
+ if (!input2)
19772
+ return [];
19773
+ const value = input2[targetKey];
19774
+ if (Array.isArray(value))
19775
+ return value.map(String);
19776
+ if (["string", "number"].includes(typeof value))
19777
+ return [String(value)];
19778
+ return [];
19779
+ };
19780
+ var collectTargets = (input2, targetKey) => {
19781
+ if (targetKey)
19782
+ return collectDirectTargetValues(input2, targetKey);
19783
+ for (const targetKey2 of targetKeys) {
19784
+ const values = collectValuesForKey(input2, targetKey2);
19765
19785
  if (values.length > 0)
19766
19786
  return values;
19767
19787
  }
19768
19788
  return [];
19769
19789
  };
19770
- var requireEffects = async (effects, flags, confirm, input2) => {
19790
+ var requireEffects = async (effects, flags, confirm, input2, targetKey) => {
19771
19791
  if (effects.length === 0)
19772
19792
  return;
19773
19793
  const missing = effects.filter((effect) => {
@@ -19776,7 +19796,7 @@ var requireEffects = async (effects, flags, confirm, input2) => {
19776
19796
  });
19777
19797
  const targetRequired = effects.some((effect) => effect !== "sensitive-data");
19778
19798
  const target = getStringFlag(flags, "--target");
19779
- const candidates = targetRequired ? collectTargets(input2) : [];
19799
+ const candidates = targetRequired ? collectTargets(input2, targetKey) : [];
19780
19800
  const targetMatches = !targetRequired || target !== undefined && candidates.includes(target);
19781
19801
  if (missing.length === 0 && targetMatches)
19782
19802
  return;
@@ -19791,13 +19811,26 @@ var requireEffects = async (effects, flags, confirm, input2) => {
19791
19811
  ];
19792
19812
  throw new CliUsageError(`Command requires ${requirements.join(" and ")} in non-interactive use.${candidates.length > 0 ? ` Expected target: ${candidates.join(" or ")}.` : ""}`);
19793
19813
  };
19814
+ var knownCommandNames = new Set([
19815
+ "help",
19816
+ "manifest",
19817
+ "version",
19818
+ "health",
19819
+ "auth login",
19820
+ "auth status",
19821
+ "auth logout",
19822
+ "auth whoami",
19823
+ ...Object.keys(commands)
19824
+ ]);
19794
19825
  var runRsvpCli = async (argv, dependencies) => {
19795
- let command = argv.filter((argument) => !argument.startsWith("--")).join(" ");
19796
- if (!command)
19797
- command = "help";
19826
+ let command = "unknown";
19798
19827
  try {
19799
19828
  const parsed = parseArgs(argv);
19800
- command = parsed.positionals.join(" ") || "help";
19829
+ const requestedCommand = parsed.positionals.join(" ") || "help";
19830
+ if (!knownCommandNames.has(requestedCommand)) {
19831
+ throw new CliUsageError("Unknown command. Run 'rsvp help' to list commands.");
19832
+ }
19833
+ command = requestedCommand;
19801
19834
  if (command === "help") {
19802
19835
  output2(dependencies.io, command, getCommandManifest());
19803
19836
  return 0;
@@ -19915,7 +19948,7 @@ Waiting for approval\u2026
19915
19948
  if (!definition)
19916
19949
  throw new CliUsageError("Unknown command. Run 'rsvp help' to list commands.");
19917
19950
  const input2 = getInput(parsed.flags, definition.payloadOnly, definition.scope);
19918
- await requireEffects(definition.effects, parsed.flags, dependencies.confirm, input2);
19951
+ await requireEffects(definition.effects, parsed.flags, dependencies.confirm, input2, definition.targetKey);
19919
19952
  const accessToken = !dependencies.apiClient && !definition.public ? await getAuthenticatedAccessToken({
19920
19953
  apiBaseUrl,
19921
19954
  store: getCredentialStore()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-labs-sg/rsvp",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "RSVP CLI for authorized event operations.",
5
5
  "type": "module",
6
6
  "exports": {},