@chatlychat/cli 0.4.1 → 0.5.2
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/commands/auth.d.ts +1 -1
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +40 -3
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/deliveries.d.ts +18 -0
- package/dist/commands/deliveries.d.ts.map +1 -0
- package/dist/commands/deliveries.js +46 -0
- package/dist/commands/deliveries.js.map +1 -0
- package/dist/commands/init.d.ts +29 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +176 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/integrations.d.ts +27 -0
- package/dist/commands/integrations.d.ts.map +1 -1
- package/dist/commands/integrations.js +145 -4
- package/dist/commands/integrations.js.map +1 -1
- package/dist/commands/platform-as-code.d.ts +54 -0
- package/dist/commands/platform-as-code.d.ts.map +1 -0
- package/dist/commands/platform-as-code.js +185 -0
- package/dist/commands/platform-as-code.js.map +1 -0
- package/dist/commands/workspace-as-code.d.ts +52 -11
- package/dist/commands/workspace-as-code.d.ts.map +1 -1
- package/dist/commands/workspace-as-code.js +70 -189
- package/dist/commands/workspace-as-code.js.map +1 -1
- package/dist/help.d.ts +1 -1
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +36 -1
- package/dist/help.js.map +1 -1
- package/dist/init/shared.d.ts +61 -0
- package/dist/init/shared.d.ts.map +1 -0
- package/dist/init/shared.js +110 -0
- package/dist/init/shared.js.map +1 -0
- package/dist/init/templates.d.ts +29 -0
- package/dist/init/templates.d.ts.map +1 -0
- package/dist/init/templates.js +362 -0
- package/dist/init/templates.js.map +1 -0
- package/dist/pac/platform-document.d.ts +65 -0
- package/dist/pac/platform-document.d.ts.map +1 -0
- package/dist/pac/platform-document.js +149 -0
- package/dist/pac/platform-document.js.map +1 -0
- package/dist/pac/platform-live.d.ts +65 -0
- package/dist/pac/platform-live.d.ts.map +1 -0
- package/dist/pac/platform-live.js +263 -0
- package/dist/pac/platform-live.js.map +1 -0
- package/dist/pac/platform-resources.d.ts +141 -0
- package/dist/pac/platform-resources.d.ts.map +1 -0
- package/dist/pac/platform-resources.js +509 -0
- package/dist/pac/platform-resources.js.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +26 -2
- package/dist/run.js.map +1 -1
- package/dist/wac/apply.d.ts.map +1 -1
- package/dist/wac/apply.js +56 -16
- package/dist/wac/apply.js.map +1 -1
- package/dist/wac/diff-warnings.d.ts +35 -0
- package/dist/wac/diff-warnings.d.ts.map +1 -0
- package/dist/wac/diff-warnings.js +88 -0
- package/dist/wac/diff-warnings.js.map +1 -0
- package/dist/wac/diff.d.ts +40 -70
- package/dist/wac/diff.d.ts.map +1 -1
- package/dist/wac/diff.js +114 -91
- package/dist/wac/diff.js.map +1 -1
- package/dist/wac/document-key.d.ts +30 -0
- package/dist/wac/document-key.d.ts.map +1 -0
- package/dist/wac/document-key.js +87 -0
- package/dist/wac/document-key.js.map +1 -0
- package/dist/wac/document.d.ts +75 -65
- package/dist/wac/document.d.ts.map +1 -1
- package/dist/wac/document.js +60 -46
- package/dist/wac/document.js.map +1 -1
- package/dist/wac/execute.d.ts +25 -0
- package/dist/wac/execute.d.ts.map +1 -0
- package/dist/wac/execute.js +126 -0
- package/dist/wac/execute.js.map +1 -0
- package/dist/wac/load.d.ts +17 -0
- package/dist/wac/load.d.ts.map +1 -0
- package/dist/wac/load.js +92 -0
- package/dist/wac/load.js.map +1 -0
- package/dist/wac/resource-def.d.ts +89 -1
- package/dist/wac/resource-def.d.ts.map +1 -1
- package/dist/wac/resource-def.js +4 -0
- package/dist/wac/resource-def.js.map +1 -1
- package/dist/wac/resources.d.ts +9 -11
- package/dist/wac/resources.d.ts.map +1 -1
- package/dist/wac/resources.js +93 -27
- package/dist/wac/resources.js.map +1 -1
- package/dist/wac/values.d.ts +20 -0
- package/dist/wac/values.d.ts.map +1 -1
- package/dist/wac/values.js +46 -0
- package/dist/wac/values.js.map +1 -1
- package/package.json +4 -3
package/dist/wac/load.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Getting a document off disk, for both `chatly plan` and
|
|
3
|
+
* `chatly platform plan`.
|
|
4
|
+
*
|
|
5
|
+
* ═══ JSON AND YAML ════════════════════════════════════════════════════════
|
|
6
|
+
*
|
|
7
|
+
* `.yaml` / `.yml` parse as YAML, `.json` as JSON, and `--file -` is sniffed:
|
|
8
|
+
* JSON if the first non-space character is `{`, YAML otherwise. The owner
|
|
9
|
+
* approved `yaml` (zero dependencies) as the CLI's only runtime dependency on
|
|
10
|
+
* 2026-10-26. Both paths produce a plain value that goes through the SAME
|
|
11
|
+
* `parseDocument` validation; there is nothing YAML-specific past the parser.
|
|
12
|
+
*
|
|
13
|
+
* Strict mode, unique keys, and any warning is an error — an unknown tag such
|
|
14
|
+
* as `!!js/function` only WARNS in `yaml`, and a document that loads while
|
|
15
|
+
* meaning something other than what it says is the failure we refuse.
|
|
16
|
+
*
|
|
17
|
+
* ═══ WHY IT MOVED HERE ════════════════════════════════════════════════════
|
|
18
|
+
*
|
|
19
|
+
* `chatly platform plan` needs the identical loader with a different default
|
|
20
|
+
* filename and a different schema. The alternative — importing it from
|
|
21
|
+
* `commands/workspace-as-code.ts` — would have one command module depend on
|
|
22
|
+
* another for a filesystem helper, and the YAML refusal is the sort of thing
|
|
23
|
+
* that gets copied and then diverges in one copy. `workspace-as-code.ts`
|
|
24
|
+
* re-exports `loadDocument`, so nothing that imported it from there moved.
|
|
25
|
+
*/
|
|
26
|
+
import { readFileSync } from 'node:fs';
|
|
27
|
+
import { parseDocument as parseYamlDocument } from 'yaml';
|
|
28
|
+
import { parseDocument } from './document.js';
|
|
29
|
+
import { str } from '../args.js';
|
|
30
|
+
function readFile(path) {
|
|
31
|
+
try {
|
|
32
|
+
// `0` is stdin, so `converter | chatly plan --file -` works.
|
|
33
|
+
return path === '-' ? readFileSync(0, 'utf8') : readFileSync(path, 'utf8');
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
throw new Error(`Cannot read ${path}: ${err instanceof Error ? err.message : String(err)}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function findDefault(opts) {
|
|
40
|
+
for (const candidate of opts.defaultFiles) {
|
|
41
|
+
try {
|
|
42
|
+
readFileSync(candidate, 'utf8');
|
|
43
|
+
return candidate;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const names = opts.defaultFiles.join(', ');
|
|
50
|
+
throw new Error(`No document found. Looked for ${names} in this directory.\n` +
|
|
51
|
+
`Pass one with --file, or --file - to read stdin.\n` +
|
|
52
|
+
`There is a worked example at ${opts.docsUrl}`);
|
|
53
|
+
}
|
|
54
|
+
/** By extension; anything else (stdin, no extension) by sniffing for a leading `{`. */
|
|
55
|
+
export function isYaml(path, raw) {
|
|
56
|
+
if (/\.ya?ml$/i.test(path)) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
if (/\.json$/i.test(path)) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
return !/^\s*\{/.test(raw);
|
|
63
|
+
}
|
|
64
|
+
function parseYaml(path, raw) {
|
|
65
|
+
const doc = parseYamlDocument(raw, { strict: true, uniqueKeys: true, prettyErrors: true });
|
|
66
|
+
const problem = doc.errors[0] ?? doc.warnings[0];
|
|
67
|
+
if (problem) {
|
|
68
|
+
const at = problem.linePos?.[0];
|
|
69
|
+
const where = at ? ` (line ${at.line}, column ${at.col})` : '';
|
|
70
|
+
throw new Error(`${path} is not valid YAML${where}: ${problem.message}`);
|
|
71
|
+
}
|
|
72
|
+
return doc.toJS();
|
|
73
|
+
}
|
|
74
|
+
/** Read, parse as JSON or YAML by extension (stdin: by sniffing), validate against the schema. */
|
|
75
|
+
export function loadFrom(args, env, opts) {
|
|
76
|
+
const path = str(args.flags, 'file') ?? findDefault(opts);
|
|
77
|
+
const raw = readFile(path);
|
|
78
|
+
let parsed;
|
|
79
|
+
if (isYaml(path, raw)) {
|
|
80
|
+
parsed = parseYaml(path, raw);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
try {
|
|
84
|
+
parsed = JSON.parse(raw);
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
throw new Error(`${path} is not valid JSON: ${err instanceof Error ? err.message : '?'}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return parseDocument(parsed, env, opts.schema);
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=load.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/wac/load.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAyC,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,GAAG,EAAmB,MAAM,YAAY,CAAC;AAalD,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,CAAC;QACH,6DAA6D;QAC7D,OAAO,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC7E,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,eAAe,IAAI,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC9F,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,IAAiB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AC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,qBAAqB,KAAK,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;AACpB,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,QAAQ,CAAC,IAAgB,EAAE,GAAsB,EAAE,IAAiB;IAClF,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,MAAe,CAAC;IACpB,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAChC,CAAC;SAAM,CAAC;QACN,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,uBAAuB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;QAC5F,CAAC;IACH,CAAC;IACD,OAAO,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -15,9 +15,36 @@ export interface ResourceRef {
|
|
|
15
15
|
readonly type: string;
|
|
16
16
|
/** The field the API actually reads, which the ref resolves into. */
|
|
17
17
|
readonly wire: string;
|
|
18
|
+
/**
|
|
19
|
+
* The resolved id fills a `{wire}` placeholder in the ROUTE PATH rather
|
|
20
|
+
* than a field in the body.
|
|
21
|
+
*
|
|
22
|
+
* Every workspace-level resource here is reached at a flat collection path
|
|
23
|
+
* and names its parent in the body (`botRoutes` sends `botId`). The
|
|
24
|
+
* Platform API is the opposite shape: a user, a key, a bot credential and a
|
|
25
|
+
* knowledge source all live under
|
|
26
|
+
* `/v1/platform/workspaces/{workspaceId}/…`, and the workspace id is a path
|
|
27
|
+
* segment that no request body accepts.
|
|
28
|
+
*
|
|
29
|
+
* It matters that these are different rather than interchangeable. zod
|
|
30
|
+
* strips an unknown key, so sending `workspaceId` in the body of
|
|
31
|
+
* `POST /v1/platform/workspaces/{id}/users` would be dropped in silence and
|
|
32
|
+
* the route would answer 201 — the failure mode CLAUDE.md names twice. A
|
|
33
|
+
* path ref is therefore excluded from the body AND excluded from the diff:
|
|
34
|
+
* the live row has no such field, so comparing it would report a change on
|
|
35
|
+
* every single run.
|
|
36
|
+
*/
|
|
37
|
+
readonly pathParam?: boolean;
|
|
18
38
|
}
|
|
19
39
|
export interface UpdateRoute {
|
|
20
|
-
|
|
40
|
+
/**
|
|
41
|
+
* `POST` is here for one shape only: a route whose POST ADOPTS an existing
|
|
42
|
+
* resource and merges into it rather than creating a second one.
|
|
43
|
+
* `POST /v1/platform/workspaces/{id}/widget_channel` is the instance —
|
|
44
|
+
* `created: false` is its normal answer. A POST that creates is `create`,
|
|
45
|
+
* not an update route.
|
|
46
|
+
*/
|
|
47
|
+
readonly method: 'PATCH' | 'PUT' | 'POST';
|
|
21
48
|
/** `{id}` is replaced with the encoded live id. */
|
|
22
49
|
readonly path: string;
|
|
23
50
|
/**
|
|
@@ -39,6 +66,10 @@ export interface ResourceDef {
|
|
|
39
66
|
readonly keySource: 'authored' | 'server';
|
|
40
67
|
/** True when the database enforces the key. False when only this file does. */
|
|
41
68
|
readonly keyEnforced: boolean;
|
|
69
|
+
/** A shape the authored key must have, checked at parse time rather than on a 400 at apply. */
|
|
70
|
+
readonly keyPattern?: RegExp;
|
|
71
|
+
/** Appended to the "rows with no key" warning: how to give an existing row one. */
|
|
72
|
+
readonly keylessHint?: string;
|
|
42
73
|
/** The server's own normalisation, applied to both sides before matching. */
|
|
43
74
|
readonly normalizeKey?: (key: string) => string;
|
|
44
75
|
readonly list: {
|
|
@@ -66,6 +97,12 @@ export interface ResourceDef {
|
|
|
66
97
|
readonly path: string;
|
|
67
98
|
} | null;
|
|
68
99
|
readonly removeBlocked?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Object fields the server MERGES into what it holds (`settings`'
|
|
102
|
+
* `businessHours`, `routing`, `widgetChannel`): compared on the keys the
|
|
103
|
+
* document names, recursively, because a key it omits is kept as stored.
|
|
104
|
+
*/
|
|
105
|
+
readonly mergeFields?: ReadonlyArray<string>;
|
|
69
106
|
/**
|
|
70
107
|
* Fields that are never readable back, so a diff must not claim they
|
|
71
108
|
* changed. Half the answer; the other half is the `__redacted__` sentinel,
|
|
@@ -88,7 +125,58 @@ export interface ResourceDef {
|
|
|
88
125
|
readonly project?: (row: Record<string, unknown>) => Record<string, unknown>;
|
|
89
126
|
/** Document-only keys naming another resource by ITS natural key. */
|
|
90
127
|
readonly references?: Readonly<Record<string, ResourceRef>>;
|
|
128
|
+
/**
|
|
129
|
+
* The rows out of a list response that is not itself the array.
|
|
130
|
+
*
|
|
131
|
+
* Every workspace-level list route answers either a bare array or
|
|
132
|
+
* `{ items, nextCursor }`, which `readLive` handles directly. The Platform
|
|
133
|
+
* API has one list that is neither: a workspace's MEMBERS come back as
|
|
134
|
+
* `users` on `GET /v1/platform/workspaces/{id}` — the detail route — because
|
|
135
|
+
* there is no `…/users` list route at all. Declared rather than special-cased
|
|
136
|
+
* in the reader so the reader stays one loop.
|
|
137
|
+
*/
|
|
138
|
+
readonly rowsFrom?: (response: unknown) => ReadonlyArray<Record<string, unknown>>;
|
|
139
|
+
/**
|
|
140
|
+
* A live row this document can never match, and must not be matched to.
|
|
141
|
+
*
|
|
142
|
+
* `GET /v1/platform/workspaces/{id}/api_keys` keeps a REVOKED key in the
|
|
143
|
+
* list with `revokedAt` set, and so does the bot-credential list. A
|
|
144
|
+
* revoked credential is not a credential: matching a document row to one
|
|
145
|
+
* would report `noop` for a key that authenticates nothing, which is the
|
|
146
|
+
* worst possible answer — the plan would say the workspace matches the file
|
|
147
|
+
* while the deploy pipeline it describes is locked out. Filtered out, so
|
|
148
|
+
* the document's row is a `create` and `apply` mints a live one.
|
|
149
|
+
*
|
|
150
|
+
* It is NOT the same thing as an orphan: a filtered row is invisible, so
|
|
151
|
+
* `--prune` never offers to delete it either, which is right for a row the
|
|
152
|
+
* DELETE route would answer `revoked: false` to.
|
|
153
|
+
*/
|
|
154
|
+
readonly ignoreLive?: (row: Record<string, unknown>) => boolean;
|
|
155
|
+
/**
|
|
156
|
+
* The resource that OWNS this one, for a type whose list route is nested
|
|
157
|
+
* under a parent's id.
|
|
158
|
+
*
|
|
159
|
+
* Present only on the Platform API's resources. Its consequence is that
|
|
160
|
+
* `naturalKey` is a SYNTHETIC field — the parent's key and the child's,
|
|
161
|
+
* joined — because `a@b.c` identifies a user inside one workspace and
|
|
162
|
+
* nothing at all across a document that describes four of them. The reader
|
|
163
|
+
* stamps that field onto every live row it fetches; the parser composes the
|
|
164
|
+
* same value from the document. Neither side ever diffs it, because
|
|
165
|
+
* `diff.ts` skips the natural key.
|
|
166
|
+
*/
|
|
167
|
+
readonly parent?: {
|
|
168
|
+
/** The owning resource type. */
|
|
169
|
+
readonly type: string;
|
|
170
|
+
/** The document key that names the parent (`workspace`). */
|
|
171
|
+
readonly field: string;
|
|
172
|
+
/** The path placeholder the parent's id fills (`workspaceId`). */
|
|
173
|
+
readonly wire: string;
|
|
174
|
+
/** The field that names the child within its parent (`email`, `name`). */
|
|
175
|
+
readonly childKey: string;
|
|
176
|
+
};
|
|
91
177
|
}
|
|
178
|
+
/** The synthetic natural key of a parented resource: `<parent>/<child>`. */
|
|
179
|
+
export declare function addressOf(parentKey: string, childKey: string): string;
|
|
92
180
|
/** The server's spelling of a key, for matching. */
|
|
93
181
|
export declare function normalizedKey(def: ResourceDef, key: string): string;
|
|
94
182
|
/** The live row in the vocabulary the document writes. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-def.d.ts","sourceRoot":"","sources":["../../src/wac/resource-def.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,sCAAsC;AACtC,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzE,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"resource-def.d.ts","sourceRoot":"","sources":["../../src/wac/resource-def.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,sCAAsC;AACtC,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzE,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IAC1C,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,WAAW;IAC1B,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,QAA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aAAa,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,0DAA0D;AAC1D,wBAAgB,SAAS,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEjG;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAKtF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE1D"}
|
package/dist/wac/resource-def.js
CHANGED
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
* `resources.ts` re-exports everything here, so every importer sees one
|
|
9
9
|
* module.
|
|
10
10
|
*/
|
|
11
|
+
/** The synthetic natural key of a parented resource: `<parent>/<child>`. */
|
|
12
|
+
export function addressOf(parentKey, childKey) {
|
|
13
|
+
return `${parentKey}/${childKey}`;
|
|
14
|
+
}
|
|
11
15
|
/** The server's spelling of a key, for matching. */
|
|
12
16
|
export function normalizedKey(def, key) {
|
|
13
17
|
return def.normalizeKey === undefined ? key : def.normalizeKey(key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-def.js","sourceRoot":"","sources":["../../src/wac/resource-def.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"resource-def.js","sourceRoot":"","sources":["../../src/wac/resource-def.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAwKH,4EAA4E;AAC5E,MAAM,UAAU,SAAS,CAAC,SAAiB,EAAE,QAAgB;IAC3D,OAAO,GAAG,SAAS,IAAI,QAAQ,EAAE,CAAC;AACpC,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,aAAa,CAAC,GAAgB,EAAE,GAAW;IACzD,OAAO,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AACtE,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,SAAS,CAAC,GAAgB,EAAE,GAA4B;IACtE,OAAO,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,GAAgB,EAAE,KAAa;IAC3D,OAAO,CACL,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;QAC1D,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAC/C,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,OAAO,qDAAqD,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3E,CAAC"}
|
package/dist/wac/resources.d.ts
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* triggers name NO CONSTRAINT
|
|
31
31
|
* webhooks url NO CONSTRAINT
|
|
32
32
|
* docsSources label NO CONSTRAINT
|
|
33
|
-
* channels
|
|
33
|
+
* channels key UNIQUE (workspace_id, key) WHERE NOT NULL — nullable
|
|
34
34
|
*
|
|
35
35
|
* The first five are real: the database refuses a second row, so matching on
|
|
36
36
|
* the key cannot pick the wrong one. The next four are a CONVENTION the
|
|
@@ -38,17 +38,15 @@
|
|
|
38
38
|
* refuses to touch a key that appears twice on either side instead of
|
|
39
39
|
* guessing, which is the only honest thing to do with a key that can repeat.
|
|
40
40
|
*
|
|
41
|
-
* ── The resource
|
|
41
|
+
* ── The resource that needed a key added ────────────────────────────────
|
|
42
42
|
*
|
|
43
|
-
* CHANNELS. `publicId` is
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* `
|
|
50
|
-
* the reason — not half-supported. `chatly channels create|update` is the
|
|
51
|
-
* way, and that is what the refusal says.
|
|
43
|
+
* CHANNELS. `publicId` is a RESERVATION, not a name: `channels_public_id_unique`
|
|
44
|
+
* is global, so another tenant may already hold `web`, and the server mints
|
|
45
|
+
* one when none is sent. Until 2026-10-26 a `channels:` section was refused for
|
|
46
|
+
* that reason. Migration 0680 added `channels.key`, a workspace-unique name the
|
|
47
|
+
* author chooses, and the section matches on it. `publicId` stays an OUTPUT
|
|
48
|
+
* (printed after `apply`); `type` is fixed at create; credentials inside
|
|
49
|
+
* `config` are write-only per leaf; and `--prune` never deletes one.
|
|
52
50
|
*
|
|
53
51
|
* ═══ VERIFIED AGAINST HANDLERS, NOT AGAINST NAMES ════════════════════════
|
|
54
52
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../src/wac/resources.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../src/wac/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsFG;AAEH,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEjG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAWrD;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,EAAE,aAAa,CAAC,WAAW,CAwfhD,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,MAAM,CAAgC,CAAC;AAIlF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEjE"}
|
package/dist/wac/resources.js
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* triggers name NO CONSTRAINT
|
|
31
31
|
* webhooks url NO CONSTRAINT
|
|
32
32
|
* docsSources label NO CONSTRAINT
|
|
33
|
-
* channels
|
|
33
|
+
* channels key UNIQUE (workspace_id, key) WHERE NOT NULL — nullable
|
|
34
34
|
*
|
|
35
35
|
* The first five are real: the database refuses a second row, so matching on
|
|
36
36
|
* the key cannot pick the wrong one. The next four are a CONVENTION the
|
|
@@ -38,17 +38,15 @@
|
|
|
38
38
|
* refuses to touch a key that appears twice on either side instead of
|
|
39
39
|
* guessing, which is the only honest thing to do with a key that can repeat.
|
|
40
40
|
*
|
|
41
|
-
* ── The resource
|
|
41
|
+
* ── The resource that needed a key added ────────────────────────────────
|
|
42
42
|
*
|
|
43
|
-
* CHANNELS. `publicId` is
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* `
|
|
50
|
-
* the reason — not half-supported. `chatly channels create|update` is the
|
|
51
|
-
* way, and that is what the refusal says.
|
|
43
|
+
* CHANNELS. `publicId` is a RESERVATION, not a name: `channels_public_id_unique`
|
|
44
|
+
* is global, so another tenant may already hold `web`, and the server mints
|
|
45
|
+
* one when none is sent. Until 2026-10-26 a `channels:` section was refused for
|
|
46
|
+
* that reason. Migration 0680 added `channels.key`, a workspace-unique name the
|
|
47
|
+
* author chooses, and the section matches on it. `publicId` stays an OUTPUT
|
|
48
|
+
* (printed after `apply`); `type` is fixed at create; credentials inside
|
|
49
|
+
* `config` are write-only per leaf; and `--prune` never deletes one.
|
|
52
50
|
*
|
|
53
51
|
* ═══ VERIFIED AGAINST HANDLERS, NOT AGAINST NAMES ════════════════════════
|
|
54
52
|
*
|
|
@@ -507,30 +505,98 @@ export const RESOURCES = [
|
|
|
507
505
|
'collectionId',
|
|
508
506
|
],
|
|
509
507
|
},
|
|
508
|
+
{
|
|
509
|
+
type: 'aiTools',
|
|
510
|
+
label: 'AI tool',
|
|
511
|
+
/*
|
|
512
|
+
* `name`: `ai_custom_tools_name_unique` is a partial unique index on
|
|
513
|
+
* (workspace_id, name) WHERE deleted_at IS NULL, so the database enforces
|
|
514
|
+
* it. `GET /v1/ai/tools` is `@PaginationExempt` — a bare array.
|
|
515
|
+
*/
|
|
516
|
+
naturalKey: 'name',
|
|
517
|
+
keySource: 'authored',
|
|
518
|
+
keyEnforced: true,
|
|
519
|
+
list: { path: '/v1/ai/tools', paged: false },
|
|
520
|
+
idField: 'id',
|
|
521
|
+
create: { path: '/v1/ai/tools' },
|
|
522
|
+
// PATCH takes the create schema `.partial()`, so every settable field is changeable.
|
|
523
|
+
update: [{ method: 'PATCH', path: '/v1/ai/tools/{id}' }],
|
|
524
|
+
// 200 with `{ deleted: true }`.
|
|
525
|
+
remove: { path: '/v1/ai/tools/{id}' },
|
|
526
|
+
/*
|
|
527
|
+
* Both are write-only: the read carries `secretHeaderNames` and
|
|
528
|
+
* `signingSecretSet` instead of the values.
|
|
529
|
+
*/
|
|
530
|
+
opaque: ['secretHeaders', 'signingSecret'],
|
|
531
|
+
secrets: [],
|
|
532
|
+
unwritable: [...SERVER_OWNED, 'secretHeaderNames', 'signingSecretSet'],
|
|
533
|
+
project: (row) => ({ ...row, secretHeaders: undefined, signingSecret: undefined }),
|
|
534
|
+
},
|
|
510
535
|
{
|
|
511
536
|
type: 'channels',
|
|
512
537
|
label: 'channel',
|
|
513
538
|
/*
|
|
514
|
-
*
|
|
515
|
-
*
|
|
516
|
-
*
|
|
517
|
-
*
|
|
518
|
-
*
|
|
519
|
-
*
|
|
539
|
+
* `key` (migration 0680): a workspace-unique name the AUTHOR picks,
|
|
540
|
+
* enforced by a partial unique index. `publicId` cannot be the key — it is
|
|
541
|
+
* a globally unique reservation the server mints — so it is an OUTPUT:
|
|
542
|
+
* refused in a document (`unwritable`) and printed after `apply`.
|
|
543
|
+
* Channels that predate the column have no key and cannot be matched;
|
|
544
|
+
* `chatly channels set-key <id> <key>` adopts one.
|
|
520
545
|
*/
|
|
521
|
-
naturalKey: '
|
|
522
|
-
keySource: '
|
|
546
|
+
naturalKey: 'key',
|
|
547
|
+
keySource: 'authored',
|
|
523
548
|
keyEnforced: true,
|
|
549
|
+
keyPattern: /^[a-z][a-z0-9-]{0,63}$/,
|
|
550
|
+
keylessHint: 'adopt one with `chatly channels set-key <id> <key>`, or a create here makes a second channel.',
|
|
524
551
|
list: { path: '/v1/channels', paged: false },
|
|
525
552
|
idField: 'id',
|
|
526
|
-
create:
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
553
|
+
create: { path: '/v1/channels' },
|
|
554
|
+
/*
|
|
555
|
+
* No catch-all: `type` is fixed at create, so a changed `type` is reported
|
|
556
|
+
* as un-appliable instead of sent to a PATCH that strips it. `config` is
|
|
557
|
+
* merged by the server (RFC 7396), so it is compared on the keys named.
|
|
558
|
+
*/
|
|
559
|
+
update: [
|
|
560
|
+
{
|
|
561
|
+
method: 'PATCH',
|
|
562
|
+
path: '/v1/channels/{id}',
|
|
563
|
+
fields: [
|
|
564
|
+
'name',
|
|
565
|
+
'enabled',
|
|
566
|
+
'config',
|
|
567
|
+
'autoCreateTickets',
|
|
568
|
+
'autoAcknowledge',
|
|
569
|
+
'acknowledgeTemplate',
|
|
570
|
+
'acknowledgeSubject',
|
|
571
|
+
],
|
|
572
|
+
},
|
|
573
|
+
],
|
|
574
|
+
updateBlocked: '`type` is fixed at create. Give the new channel another `key` (the old one then shows ' +
|
|
575
|
+
'as on the server only) or delete it in the dashboard first.',
|
|
576
|
+
mergeFields: ['config'],
|
|
577
|
+
/*
|
|
578
|
+
* `DELETE /v1/channels/{id}` exists but is not key-accessible, and it
|
|
579
|
+
* detaches the channel's conversations. Not something `--prune` should do.
|
|
580
|
+
*/
|
|
581
|
+
remove: null,
|
|
582
|
+
removeBlocked: 'a channel cannot be deleted with an API key, and deleting one detaches its conversations. ' +
|
|
583
|
+
'Delete it in the dashboard; `--prune` never will.',
|
|
584
|
+
/*
|
|
585
|
+
* Credentials live inside `config` and read back as `__redacted__`; they
|
|
586
|
+
* are split out per leaf in `diff.ts` (write-only, `--write-only` to push).
|
|
587
|
+
*/
|
|
588
|
+
opaque: [],
|
|
589
|
+
secrets: [],
|
|
590
|
+
unwritable: [
|
|
591
|
+
...SERVER_OWNED,
|
|
592
|
+
'publicId',
|
|
593
|
+
'originsRestricted',
|
|
594
|
+
'originWarnings',
|
|
595
|
+
'embed',
|
|
596
|
+
'brandId',
|
|
597
|
+
'lastMessageAt',
|
|
598
|
+
'staleEndpoints',
|
|
599
|
+
],
|
|
534
600
|
},
|
|
535
601
|
];
|
|
536
602
|
export const RESOURCE_TYPES = RESOURCES.map((r) => r.type);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/wac/resources.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/wac/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsFG;AAGH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIjG,2DAA2D;AAC3D,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,CAAU,CAAC;AAE9E,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oBACR,mBAAmB;oBACnB,iBAAiB;oBACjB,qBAAqB;oBACrB,oBAAoB;iBACrB;aACF;SACF;QACD,aAAa,EACX,wFAAwF;YACxF,6DAA6D;QAC/D,WAAW,EAAE,CAAC,QAAQ,CAAC;QACvB;;;WAGG;QACH,MAAM,EAAE,IAAI;QACZ,aAAa,EACX,4FAA4F;YAC5F,mDAAmD;QACrD;;;WAGG;QACH,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;QACX,UAAU,EAAE;YACV,GAAG,YAAY;YACf,UAAU;YACV,mBAAmB;YACnB,gBAAgB;YAChB,OAAO;YACP,SAAS;YACT,eAAe;YACf,gBAAgB;SACjB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAA0B,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAElF,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3D,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
package/dist/wac/values.d.ts
CHANGED
|
@@ -13,4 +13,24 @@ export declare const REDACTED = "__redacted__";
|
|
|
13
13
|
export declare function sameValue(a: unknown, b: unknown): boolean;
|
|
14
14
|
/** Does this value carry the redaction sentinel anywhere inside it? */
|
|
15
15
|
export declare function isRedacted(value: unknown): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The part of a live value a MERGE-written field describes: the keys the
|
|
18
|
+
* document names, recursively. The server keeps every key the write omits,
|
|
19
|
+
* so an omitted key is not a difference. Arrays are compared whole — a list
|
|
20
|
+
* the document names is the list it wants.
|
|
21
|
+
*/
|
|
22
|
+
export declare function narrowTo(live: unknown, desired: unknown): unknown;
|
|
23
|
+
/**
|
|
24
|
+
* A MERGE-written object compared leaf by leaf, so one redacted credential
|
|
25
|
+
* hides itself and nothing else. `live` and `desired` come back with every
|
|
26
|
+
* path whose live value is `__redacted__` (or sits inside a redacted array)
|
|
27
|
+
* removed from BOTH; `redacted` says whether any was. Without this a single
|
|
28
|
+
* `identityVerification.secret` in a channel's `config` made the whole
|
|
29
|
+
* `config` unreadable, and drift on its other keys went unreported.
|
|
30
|
+
*/
|
|
31
|
+
export declare function splitRedacted(live: unknown, desired: unknown): {
|
|
32
|
+
live: unknown;
|
|
33
|
+
desired: unknown;
|
|
34
|
+
redacted: boolean;
|
|
35
|
+
};
|
|
16
36
|
//# sourceMappingURL=values.d.ts.map
|
package/dist/wac/values.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../src/wac/values.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,uEAAuE;AACvE,eAAO,MAAM,QAAQ,iBAAiB,CAAC;AAIvC,iDAAiD;AACjD,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAyBzD;AAED,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAWlD"}
|
|
1
|
+
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../src/wac/values.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,uEAAuE;AACvE,eAAO,MAAM,QAAQ,iBAAiB,CAAC;AAIvC,iDAAiD;AACjD,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAyBzD;AAED,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAWlD;AAQD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAKjE;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,OAAO,GACf;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAoBxD"}
|
package/dist/wac/values.js
CHANGED
|
@@ -50,4 +50,50 @@ export function isRedacted(value) {
|
|
|
50
50
|
}
|
|
51
51
|
return false;
|
|
52
52
|
}
|
|
53
|
+
/* ── Merge-written fields ─────────────────────────────────────────────── */
|
|
54
|
+
function isPlainObject(v) {
|
|
55
|
+
return typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The part of a live value a MERGE-written field describes: the keys the
|
|
59
|
+
* document names, recursively. The server keeps every key the write omits,
|
|
60
|
+
* so an omitted key is not a difference. Arrays are compared whole — a list
|
|
61
|
+
* the document names is the list it wants.
|
|
62
|
+
*/
|
|
63
|
+
export function narrowTo(live, desired) {
|
|
64
|
+
if (!isPlainObject(live) || !isPlainObject(desired)) {
|
|
65
|
+
return live;
|
|
66
|
+
}
|
|
67
|
+
return Object.fromEntries(Object.keys(desired).map((k) => [k, narrowTo(live[k], desired[k])]));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A MERGE-written object compared leaf by leaf, so one redacted credential
|
|
71
|
+
* hides itself and nothing else. `live` and `desired` come back with every
|
|
72
|
+
* path whose live value is `__redacted__` (or sits inside a redacted array)
|
|
73
|
+
* removed from BOTH; `redacted` says whether any was. Without this a single
|
|
74
|
+
* `identityVerification.secret` in a channel's `config` made the whole
|
|
75
|
+
* `config` unreadable, and drift on its other keys went unreported.
|
|
76
|
+
*/
|
|
77
|
+
export function splitRedacted(live, desired) {
|
|
78
|
+
if (isPlainObject(live) && isPlainObject(desired)) {
|
|
79
|
+
const l = {};
|
|
80
|
+
const d = {};
|
|
81
|
+
let redacted = false;
|
|
82
|
+
for (const k of Object.keys(desired)) {
|
|
83
|
+
const r = splitRedacted(live[k], desired[k]);
|
|
84
|
+
if (r.redacted) {
|
|
85
|
+
redacted = true;
|
|
86
|
+
}
|
|
87
|
+
if (r.live !== SKIP) {
|
|
88
|
+
l[k] = r.live;
|
|
89
|
+
d[k] = r.desired;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return { live: l, desired: d, redacted };
|
|
93
|
+
}
|
|
94
|
+
return isRedacted(live)
|
|
95
|
+
? { live: SKIP, desired: SKIP, redacted: true }
|
|
96
|
+
: { live, desired, redacted: false };
|
|
97
|
+
}
|
|
98
|
+
const SKIP = Symbol('redacted');
|
|
53
99
|
//# sourceMappingURL=values.js.map
|
package/dist/wac/values.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/wac/values.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,uEAAuE;AACvE,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC;AAEvC,6EAA6E;AAE7E,iDAAiD;AACjD,MAAM,UAAU,SAAS,CAAC,CAAU,EAAE,CAAU;IAC9C,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IACD,mEAAmE;IACnE,IAAI,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC;QACvE,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,IAAI,CAAC,KAAK,CAAC,OAAO,C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AE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/C,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACzC,CAAC;AACD,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatlychat/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "The Chatly command line — inspect conversations, send replies, read reports and call any API route from a terminal.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/chatlychat/chatly-cli#readme",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"LICENSE"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"
|
|
33
|
+
"yaml": "^2.9.1",
|
|
34
|
+
"@chatlychat/sdk-node": "0.7.4"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@types/node": "20.14.10",
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"scripts": {
|
|
50
51
|
"build": "tsc -p tsconfig.json",
|
|
51
52
|
"dev": "tsx src/main.ts",
|
|
52
|
-
"typecheck": "
|
|
53
|
+
"typecheck": "echo \"typechecked by build: same tsconfig, see turbo.json\"",
|
|
53
54
|
"lint": "eslint src --max-warnings=0",
|
|
54
55
|
"test": "vitest run"
|
|
55
56
|
}
|