@minnovate/shadow-publisher 0.12.3 → 0.14.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "git-publisher",
3
3
  "displayName": "Git Publisher",
4
- "version": "0.12.3",
4
+ "version": "0.14.0",
5
5
  "description": "Publish an app folder's Git history to the serverless Git publishing backend and keep it updated (\"publish my app\", \"update my app\", \"fetch the engineered version\").",
6
6
  "author": { "name": "git-publisher project" },
7
7
  "keywords": ["git", "publish", "deploy", "serverless"]
@@ -52,6 +52,9 @@ publisher go-back <version> --json # ask the person first; puts that vers
52
52
  publisher suggestions --json # what colleagues asked for, still open
53
53
  publisher suggestion decline <id> --json # when the person does not want one
54
54
  publisher share invited --add ann@example.com --json # who can open it
55
+ publisher columns <id> --json # the column names of connected data, before code reads it
56
+ publisher data add <sheet link> --app <app> --name "<name>" --json # a Google sheet the app reads
57
+ publisher data remove <id> --app <app> --json # the app stops reading that data
55
58
  ```
56
59
 
57
60
  The portal writes `next` for an assistant in the chat, so it can name a connector tool. At a
@@ -66,6 +69,9 @@ terminal, do what it says with the command that does the same thing:
66
69
  | `resolve_suggestion` | `publisher suggestion done\|decline <id> --json` |
67
70
  | `share_app` | `publisher share <access> --json` |
68
71
  | `list_apps` | `publisher list --json` |
72
+ | `data_columns` | `publisher columns <id> --json` |
73
+ | `connect_data_source` | `publisher data add <sheet link> --app <app> --name "<name>" --json` |
74
+ | `remove_data_source` | `publisher data remove <id> --app <app> --json` |
69
75
 
70
76
  `<publication>` is the `publication` that `go-back` or `start` answered.
71
77
 
@@ -324,8 +324,8 @@ function mergeDefs(...defs) {
324
324
  }
325
325
  var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
326
326
  };
327
- function isObject(data) {
328
- return typeof data === "object" && data !== null && !Array.isArray(data);
327
+ function isObject(data2) {
328
+ return typeof data2 === "object" && data2 !== null && !Array.isArray(data2);
329
329
  }
330
330
  function isPlainObject(o) {
331
331
  if (isObject(o) === false)
@@ -503,20 +503,20 @@ function getLengthableOrigin(input) {
503
503
  return "string";
504
504
  return "unknown";
505
505
  }
506
- function parsedType(data) {
507
- const t = typeof data;
506
+ function parsedType(data2) {
507
+ const t = typeof data2;
508
508
  switch (t) {
509
509
  case "number": {
510
- return Number.isNaN(data) ? "nan" : "number";
510
+ return Number.isNaN(data2) ? "nan" : "number";
511
511
  }
512
512
  case "object": {
513
- if (data === null) {
513
+ if (data2 === null) {
514
514
  return "null";
515
515
  }
516
- if (Array.isArray(data)) {
516
+ if (Array.isArray(data2)) {
517
517
  return "array";
518
518
  }
519
- const obj = data;
519
+ const obj = data2;
520
520
  if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) {
521
521
  return obj.constructor.name;
522
522
  }
@@ -2375,17 +2375,17 @@ var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
2375
2375
  set with(value) {
2376
2376
  own(this, "with", value);
2377
2377
  },
2378
- parse(data, params) {
2379
- return parse(this, data, params, { callee: this.parse });
2378
+ parse(data2, params) {
2379
+ return parse(this, data2, params, { callee: this.parse });
2380
2380
  },
2381
- parseAsync(data, params) {
2382
- return parseAsync(this, data, params, { callee: this.parseAsync });
2381
+ parseAsync(data2, params) {
2382
+ return parseAsync(this, data2, params, { callee: this.parseAsync });
2383
2383
  },
2384
- safeParse(data, params) {
2385
- return safeParse(this, data, params);
2384
+ safeParse(data2, params) {
2385
+ return safeParse(this, data2, params);
2386
2386
  },
2387
- safeParseAsync(data, params) {
2388
- return safeParseAsync(this, data, params);
2387
+ safeParseAsync(data2, params) {
2388
+ return safeParseAsync(this, data2, params);
2389
2389
  },
2390
2390
  check(...checks) {
2391
2391
  const def = this.def;
@@ -6852,6 +6852,7 @@ var OPTIONS = {
6852
6852
  token: { type: "string" },
6853
6853
  portal: { type: "string" },
6854
6854
  name: { type: "string" },
6855
+ app: { type: "string" },
6855
6856
  repo: { type: "string" },
6856
6857
  message: { type: "string" },
6857
6858
  publication: { type: "string" },
@@ -8059,6 +8060,10 @@ var suggestion = {
8059
8060
  return run(inv, dir, "resolve_suggestion", { app, suggestion: id, status: status2, ...runId === void 0 ? {} : { runId } });
8060
8061
  }
8061
8062
  };
8063
+ var columns = {
8064
+ git: false,
8065
+ run: (inv) => run(inv, void 0, "data_columns", inv.cmd[1] === void 0 ? {} : { id: inv.cmd[1] })
8066
+ };
8062
8067
  var share = {
8063
8068
  git: false,
8064
8069
  async run(inv) {
@@ -8070,6 +8075,24 @@ var share = {
8070
8075
  return run(inv, dir, "share_app", { app, access: access2, add: listFlag(inv, "add"), remove: listFlag(inv, "remove") });
8071
8076
  }
8072
8077
  };
8078
+ function dataCall(cmd, app, name) {
8079
+ const [, verb, subject] = cmd;
8080
+ const on = app === void 0 ? {} : { app };
8081
+ if (verb === "add" && subject !== void 0) {
8082
+ return { tool: "connect_data_source", args: { source: "google-sheet", describes: name ?? "", fields: { link: subject }, ...on } };
8083
+ }
8084
+ if (verb === "remove" && subject !== void 0) {
8085
+ return { tool: "remove_data_source", args: { id: subject, ...on } };
8086
+ }
8087
+ throw new PublisherError("INVALID_REQUEST", "data takes add <sheet link>, or remove <id> with an id from publisher columns");
8088
+ }
8089
+ var data = {
8090
+ git: false,
8091
+ async run(inv) {
8092
+ const { tool, args } = dataCall(inv.cmd, inv.str("app"), inv.str("name"));
8093
+ return run(inv, void 0, tool, args);
8094
+ }
8095
+ };
8073
8096
 
8074
8097
  // src/commands/sync.ts
8075
8098
  var sync = {
@@ -8427,6 +8450,12 @@ Usage:
8427
8450
  publisher suggestion done|decline <id> [--run <id>] close one; sync --answers <id> closes it with that publication
8428
8451
  publisher share organisation|invited|anyone-with-link [--add <emails>] [--remove <emails>]
8429
8452
  who can open this folder's app; new invitees get the link by mail
8453
+ publisher columns [<id>] the column names of connected data, for the code that reads it;
8454
+ its first rows only to an owner or admin who allowed that
8455
+ publisher data add <sheet link> [--app <app>] [--name <name>]
8456
+ connect a Google sheet anyone with the link can view, and
8457
+ turn it on for that app (an app you made, or any as owner or admin)
8458
+ publisher data remove <id> --app <app> that app stops using that data; the organisation keeps it
8430
8459
  publisher merge-check [dir] --ours <ref> --theirs <ref> [--apply]
8431
8460
  publisher info [dir] repository state as seen by the server
8432
8461
  publisher doctor environment check (node, git, credentials, association)
@@ -8477,7 +8506,9 @@ var COMMANDS = /* @__PURE__ */ new Map([
8477
8506
  ["go-back", goBack],
8478
8507
  ["suggestions", suggestions],
8479
8508
  ["suggestion", suggestion],
8480
- ["share", share]
8509
+ ["share", share],
8510
+ ["columns", columns],
8511
+ ["data", data]
8481
8512
  ]);
8482
8513
  async function main(argv) {
8483
8514
  const inv = new Invocation(parseArgs(argv));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minnovate/shadow-publisher",
3
- "version": "0.12.3",
3
+ "version": "0.14.0",
4
4
  "description": "publisher: publish an app's Git history to the serverless Git backend",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",