@minnovate/shadow-publisher 0.13.0 → 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.13.0",
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"]
@@ -53,6 +53,8 @@ publisher suggestions --json # what colleagues asked for, still ope
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
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
56
58
  ```
57
59
 
58
60
  The portal writes `next` for an assistant in the chat, so it can name a connector tool. At a
@@ -68,6 +70,8 @@ terminal, do what it says with the command that does the same thing:
68
70
  | `share_app` | `publisher share <access> --json` |
69
71
  | `list_apps` | `publisher list --json` |
70
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` |
71
75
 
72
76
  `<publication>` is the `publication` that `go-back` or `start` answered.
73
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" },
@@ -8074,6 +8075,24 @@ var share = {
8074
8075
  return run(inv, dir, "share_app", { app, access: access2, add: listFlag(inv, "add"), remove: listFlag(inv, "remove") });
8075
8076
  }
8076
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
+ };
8077
8096
 
8078
8097
  // src/commands/sync.ts
8079
8098
  var sync = {
@@ -8433,6 +8452,10 @@ Usage:
8433
8452
  who can open this folder's app; new invitees get the link by mail
8434
8453
  publisher columns [<id>] the column names of connected data, for the code that reads it;
8435
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
8436
8459
  publisher merge-check [dir] --ours <ref> --theirs <ref> [--apply]
8437
8460
  publisher info [dir] repository state as seen by the server
8438
8461
  publisher doctor environment check (node, git, credentials, association)
@@ -8484,7 +8507,8 @@ var COMMANDS = /* @__PURE__ */ new Map([
8484
8507
  ["suggestions", suggestions],
8485
8508
  ["suggestion", suggestion],
8486
8509
  ["share", share],
8487
- ["columns", columns]
8510
+ ["columns", columns],
8511
+ ["data", data]
8488
8512
  ]);
8489
8513
  async function main(argv) {
8490
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.13.0",
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",