@camstack/addon-google-services 0.2.41 → 0.2.43
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/CHANGELOG.md +12 -0
- package/dist/google-services.addon.js +288 -582
- package/dist/google-services.addon.mjs +289 -583
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash, randomBytes } from "node:crypto";
|
|
2
|
-
//#region ../types/dist/event-category-
|
|
2
|
+
//#region ../types/dist/event-category-78tcBemo.mjs
|
|
3
3
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4
4
|
EventCategory["SystemBoot"] = "system.boot";
|
|
5
5
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -120,6 +120,23 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
120
120
|
*/
|
|
121
121
|
EventCategory["AddonLoadRecovered"] = "addon.load-recovered";
|
|
122
122
|
/**
|
|
123
|
+
* An addon is RUNNING although its installed package is below what the
|
|
124
|
+
* running server requires (`camstack.requires.addons` of the server, or the
|
|
125
|
+
* addon's own `requires.server`). Raised once per streak by the unsupported-
|
|
126
|
+
* addon tracker, on the hub and on agents; AlertCenter turns it into one
|
|
127
|
+
* operator alert per node and package. The addon is never held back for it.
|
|
128
|
+
*
|
|
129
|
+
* Payload: `{ packageName, addonId, nodeId, installedVersion, requiredMinimum, serverVersion, unmet }`.
|
|
130
|
+
*/
|
|
131
|
+
EventCategory["AddonUnsupportedVersion"] = "addon.unsupported-version";
|
|
132
|
+
/**
|
|
133
|
+
* The package of an {@link AddonUnsupportedVersion} alert reached a supported
|
|
134
|
+
* version, or is no longer installed on the node. AlertCenter dismisses the matching alert.
|
|
135
|
+
*
|
|
136
|
+
* Payload: `{ packageName, addonId, nodeId }`.
|
|
137
|
+
*/
|
|
138
|
+
EventCategory["AddonUnsupportedResolved"] = "addon.unsupported-resolved";
|
|
139
|
+
/**
|
|
123
140
|
* Monitor scheduled the next retry for a failed addon. Transient —
|
|
124
141
|
* surfaced to the UI for live-updating the "next retry in Ns"
|
|
125
142
|
* countdown on the Addons page row, NOT persisted as an alert.
|
|
@@ -230,7 +247,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
230
247
|
EventCategory["ProcessRestarted"] = "process.restarted";
|
|
231
248
|
/**
|
|
232
249
|
* The SET of storage locations changed — one was created, edited, enabled,
|
|
233
|
-
* disabled or deleted through
|
|
250
|
+
* disabled or deleted through the location instances or the forced-delete action.
|
|
234
251
|
*
|
|
235
252
|
* Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
|
|
236
253
|
* it must also converge on its own periodic path, because a dropped event
|
|
@@ -5981,7 +5998,7 @@ var ZodIssueCode = {
|
|
|
5981
5998
|
var ZodFirstPartyTypeKind;
|
|
5982
5999
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5983
6000
|
//#endregion
|
|
5984
|
-
//#region ../types/dist/sleep-
|
|
6001
|
+
//#region ../types/dist/sleep-AEnTN3b4.mjs
|
|
5985
6002
|
/**
|
|
5986
6003
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5987
6004
|
* window to float samples (D455).
|
|
@@ -6690,10 +6707,33 @@ function integrationRowsApiOver(api) {
|
|
|
6690
6707
|
};
|
|
6691
6708
|
}
|
|
6692
6709
|
var PREFIX = "records/";
|
|
6710
|
+
/**
|
|
6711
|
+
* Cross-realm brand. An addon bundles its own copy of this module (D15) while
|
|
6712
|
+
* `ctx.records` is the HOST's door, so an error thrown by the host is an
|
|
6713
|
+
* instance of the host's classes, not of the addon's. The brand plus the code
|
|
6714
|
+
* make `instanceof` answer by identity of the failure, not of the copy.
|
|
6715
|
+
*/
|
|
6716
|
+
var RECORDS_ERROR_BRAND = Symbol.for("camstack.records-error");
|
|
6717
|
+
function carriesBrand(value) {
|
|
6718
|
+
return typeof value === "object" && value !== null && Reflect.get(value, RECORDS_ERROR_BRAND) === true;
|
|
6719
|
+
}
|
|
6693
6720
|
/** The base of every records failure. `detail` is the human part of the message. */
|
|
6694
6721
|
var RecordsError = class extends Error {
|
|
6722
|
+
/** The code a subclass stands for; the base stands for every code. */
|
|
6723
|
+
static code = void 0;
|
|
6724
|
+
/**
|
|
6725
|
+
* `instanceof` across copies of this module: any branded error is a
|
|
6726
|
+
* `RecordsError`, and is an instance of a subclass only when its code is the
|
|
6727
|
+
* subclass's code. Same-copy answers are unchanged.
|
|
6728
|
+
*/
|
|
6729
|
+
static [Symbol.hasInstance](value) {
|
|
6730
|
+
if (Function.prototype[Symbol.hasInstance].call(this, value)) return true;
|
|
6731
|
+
if (!carriesBrand(value)) return false;
|
|
6732
|
+
return this.code === void 0 || value.code === this.code;
|
|
6733
|
+
}
|
|
6695
6734
|
code;
|
|
6696
6735
|
detail;
|
|
6736
|
+
[RECORDS_ERROR_BRAND] = true;
|
|
6697
6737
|
constructor(code, detail) {
|
|
6698
6738
|
super(`${PREFIX}${code}: ${detail}`);
|
|
6699
6739
|
this.name = "RecordsError";
|
|
@@ -6702,22 +6742,25 @@ var RecordsError = class extends Error {
|
|
|
6702
6742
|
}
|
|
6703
6743
|
};
|
|
6704
6744
|
/** The keychain could not store or serve a value: explicit, never an empty string. */
|
|
6705
|
-
var RecordSecretUnavailableError = class extends RecordsError {
|
|
6745
|
+
var RecordSecretUnavailableError = class RecordSecretUnavailableError extends RecordsError {
|
|
6746
|
+
static code = "secret-unavailable";
|
|
6706
6747
|
constructor(detail) {
|
|
6707
|
-
super(
|
|
6748
|
+
super(RecordSecretUnavailableError.code, detail);
|
|
6708
6749
|
this.name = "RecordSecretUnavailableError";
|
|
6709
6750
|
}
|
|
6710
6751
|
};
|
|
6711
|
-
var InvalidRecordError = class extends RecordsError {
|
|
6752
|
+
var InvalidRecordError = class InvalidRecordError extends RecordsError {
|
|
6753
|
+
static code = "invalid-record";
|
|
6712
6754
|
constructor(detail) {
|
|
6713
|
-
super(
|
|
6755
|
+
super(InvalidRecordError.code, detail);
|
|
6714
6756
|
this.name = "InvalidRecordError";
|
|
6715
6757
|
}
|
|
6716
6758
|
};
|
|
6717
6759
|
/** A kind declaration the engine refuses (non-additive change, bad shape, wrong file). */
|
|
6718
|
-
var DeclarationRefusedError = class extends RecordsError {
|
|
6760
|
+
var DeclarationRefusedError = class DeclarationRefusedError extends RecordsError {
|
|
6761
|
+
static code = "declaration-refused";
|
|
6719
6762
|
constructor(detail) {
|
|
6720
|
-
super(
|
|
6763
|
+
super(DeclarationRefusedError.code, detail);
|
|
6721
6764
|
this.name = "DeclarationRefusedError";
|
|
6722
6765
|
}
|
|
6723
6766
|
};
|
|
@@ -7204,17 +7247,35 @@ var RecordIntegrationInstances = class {
|
|
|
7204
7247
|
...kind !== void 0 ? { kind } : {}
|
|
7205
7248
|
});
|
|
7206
7249
|
if (minted === void 0) throw new Error("createInstance needs an id: this provider does not mint one");
|
|
7250
|
+
const initial = this.hooks.initialBody(name, kind);
|
|
7251
|
+
const patch = this.patchOf(values ?? {});
|
|
7252
|
+
if (Object.keys(patch).length > 0) Object.assign(patch, await this.hooks.validateWrite?.({
|
|
7253
|
+
kind,
|
|
7254
|
+
body: {
|
|
7255
|
+
...initial,
|
|
7256
|
+
...patch
|
|
7257
|
+
}
|
|
7258
|
+
}));
|
|
7207
7259
|
await this.handle.put({
|
|
7208
7260
|
id: minted,
|
|
7209
|
-
data:
|
|
7261
|
+
data: initial
|
|
7210
7262
|
}, { ifRev: 0 });
|
|
7211
|
-
const patch = this.patchOf(values ?? {});
|
|
7212
7263
|
if (Object.keys(patch).length > 0) await this.handle.patch(minted, patch);
|
|
7213
7264
|
await this.hooks.onChanged?.(minted, "created");
|
|
7214
7265
|
return { id: minted };
|
|
7215
7266
|
};
|
|
7216
7267
|
updateInstance = async ({ id, name, values }) => {
|
|
7217
7268
|
const patch = this.patchOf(values);
|
|
7269
|
+
if (this.hooks.validateWrite !== void 0 && Object.keys(patch).length > 0) {
|
|
7270
|
+
const stored = await this.handle.get(id);
|
|
7271
|
+
if (stored !== null) Object.assign(patch, await this.hooks.validateWrite({
|
|
7272
|
+
kind: void 0,
|
|
7273
|
+
body: {
|
|
7274
|
+
...stored.data,
|
|
7275
|
+
...patch
|
|
7276
|
+
}
|
|
7277
|
+
}));
|
|
7278
|
+
}
|
|
7218
7279
|
if (name !== void 0) patch[this.nameField] = name;
|
|
7219
7280
|
await this.handle.patch(id, patch);
|
|
7220
7281
|
await this.hooks.onChanged?.(id, "updated");
|
|
@@ -10556,7 +10617,6 @@ var CAP_NAMES = Object.freeze([
|
|
|
10556
10617
|
"notifier",
|
|
10557
10618
|
"numeric-sensor",
|
|
10558
10619
|
"oauth-integration",
|
|
10559
|
-
"oidc-connections",
|
|
10560
10620
|
"osd",
|
|
10561
10621
|
"osd-manager",
|
|
10562
10622
|
"pet-feeder",
|
|
@@ -12448,8 +12508,7 @@ Object.freeze({
|
|
|
12448
12508
|
"device-provider": { "reloadDevice": 18e4 },
|
|
12449
12509
|
"llm": {
|
|
12450
12510
|
"generate": 6e5,
|
|
12451
|
-
"generateVision": 6e5
|
|
12452
|
-
"testProfile": 6e5
|
|
12511
|
+
"generateVision": 6e5
|
|
12453
12512
|
},
|
|
12454
12513
|
"llm-runtime": {
|
|
12455
12514
|
"complete": 6e5,
|
|
@@ -14074,17 +14133,18 @@ function composeInstanceKinds(parts, base) {
|
|
|
14074
14133
|
* message to what the kind supports — callers never special-case a service.
|
|
14075
14134
|
*
|
|
14076
14135
|
* DESIGN DECISIONS (locked):
|
|
14077
|
-
* -
|
|
14078
|
-
*
|
|
14079
|
-
*
|
|
14080
|
-
*
|
|
14081
|
-
*
|
|
14082
|
-
*
|
|
14083
|
-
*
|
|
14084
|
-
*
|
|
14085
|
-
*
|
|
14086
|
-
* routable. `send` / `testTarget` /
|
|
14087
|
-
* `
|
|
14136
|
+
* - A target is an INSTANCE of this function cap (epic #440, step 6): the
|
|
14137
|
+
* providers serve their targets as `integration-instances` records, one
|
|
14138
|
+
* record kind per target kind, and the admin lists, adds, edits, switches
|
|
14139
|
+
* and deletes them through that cap. This cap keeps what an instance cannot
|
|
14140
|
+
* say: the kind catalogue (`listTargetKinds`: capabilities, delivery
|
|
14141
|
+
* parameters, brand icon), dispatch (`send`, `testTarget`) and the form
|
|
14142
|
+
* helpers (`discoverTargets`, `probeTargetConfig`).
|
|
14143
|
+
* - `listTargetKinds` / `discoverTargets` return arrays → the generated
|
|
14144
|
+
* cap-mount auto-`concatCollection`-fans them across every registered
|
|
14145
|
+
* provider so one catalog is routable. `send` / `testTarget` /
|
|
14146
|
+
* `probeTargetConfig` route to ONE provider by the `addonId` the generated
|
|
14147
|
+
* collection router extracts from the call input.
|
|
14088
14148
|
* - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
|
|
14089
14149
|
* transformer) + UDS MsgPack both round-trip typed arrays — already used by
|
|
14090
14150
|
* `storage` / `storage-provider` / `recording` caps over the same path. No
|
|
@@ -14329,7 +14389,7 @@ var TargetKindCapsSchema = object({
|
|
|
14329
14389
|
* the union is large and not meant for runtime validation here; the exported
|
|
14330
14390
|
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
14331
14391
|
*/
|
|
14332
|
-
var ConfigSchemaPassthrough$
|
|
14392
|
+
var ConfigSchemaPassthrough$3 = unknown();
|
|
14333
14393
|
var TargetKindSchema = object({
|
|
14334
14394
|
kind: string(),
|
|
14335
14395
|
label: string(),
|
|
@@ -14366,7 +14426,7 @@ var TargetKindSchema = object({
|
|
|
14366
14426
|
* its raster path, which is the safe default for an unknown image.
|
|
14367
14427
|
*/
|
|
14368
14428
|
iconMediaType: string().optional(),
|
|
14369
|
-
configSchema: ConfigSchemaPassthrough$
|
|
14429
|
+
configSchema: ConfigSchemaPassthrough$3,
|
|
14370
14430
|
/**
|
|
14371
14431
|
* The config keys that decide WHERE this kind's secrets are sent (server,
|
|
14372
14432
|
* base URL, instance, chat, recipient). A save that changes any of them
|
|
@@ -14388,9 +14448,11 @@ var TargetKindSchema = object({
|
|
|
14388
14448
|
caps: TargetKindCapsSchema
|
|
14389
14449
|
});
|
|
14390
14450
|
/**
|
|
14391
|
-
* A
|
|
14392
|
-
*
|
|
14393
|
-
*
|
|
14451
|
+
* A target as a provider's own code sees it (the notification-center bridge, the
|
|
14452
|
+
* send path): the flat record body split into the name, the switch and the
|
|
14453
|
+
* kind's fields. `config` holds secrets; a reader that serves it to a client
|
|
14454
|
+
* REDACTS secret fields (a presence marker only) — never round-trip a stored
|
|
14455
|
+
* secret to the UI.
|
|
14394
14456
|
*/
|
|
14395
14457
|
var TargetSchema = object({
|
|
14396
14458
|
id: string(),
|
|
@@ -14433,13 +14495,13 @@ var ProbeTargetConfigResultSchema = object({
|
|
|
14433
14495
|
stateInstance: string().optional(),
|
|
14434
14496
|
error: string().optional()
|
|
14435
14497
|
});
|
|
14436
|
-
method(object({}), array(TargetKindSchema)), method(object({
|
|
14498
|
+
method(object({}), array(TargetKindSchema)), method(object({
|
|
14437
14499
|
kind: string(),
|
|
14438
14500
|
config: record(string(), unknown()).optional(),
|
|
14439
14501
|
/**
|
|
14440
14502
|
* When editing / duplicating, the blank password field never round-trips
|
|
14441
14503
|
* the stored token. Pass the source target id so the provider can restore
|
|
14442
|
-
* secrets server-side before dialling
|
|
14504
|
+
* secrets server-side before dialling.
|
|
14443
14505
|
*/
|
|
14444
14506
|
targetId: string().optional()
|
|
14445
14507
|
}), array(DiscoveredTargetSchema), { auth: "admin" }), method(object({
|
|
@@ -14462,27 +14524,6 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
|
|
|
14462
14524
|
}), TestResultSchema, {
|
|
14463
14525
|
kind: "mutation",
|
|
14464
14526
|
auth: "admin"
|
|
14465
|
-
}), method(object({
|
|
14466
|
-
target: TargetSchema,
|
|
14467
|
-
/**
|
|
14468
|
-
* Duplicate flow: create a NEW target id while copying secrets from an
|
|
14469
|
-
* existing row. The UI never holds the stored token; blank / redacted
|
|
14470
|
-
* password fields are restored from this source (D634 still applies if
|
|
14471
|
-
* destinations diverge without a re-typed secret).
|
|
14472
|
-
*/
|
|
14473
|
-
cloneSecretsFrom: string().optional()
|
|
14474
|
-
}), TargetSchema, {
|
|
14475
|
-
kind: "mutation",
|
|
14476
|
-
auth: "admin"
|
|
14477
|
-
}), method(object({ targetId: string() }), _void(), {
|
|
14478
|
-
kind: "mutation",
|
|
14479
|
-
auth: "admin"
|
|
14480
|
-
}), method(object({
|
|
14481
|
-
targetId: string(),
|
|
14482
|
-
enabled: boolean()
|
|
14483
|
-
}), _void(), {
|
|
14484
|
-
kind: "mutation",
|
|
14485
|
-
auth: "admin"
|
|
14486
14527
|
});
|
|
14487
14528
|
looseObject({
|
|
14488
14529
|
name: string().min(1),
|
|
@@ -22750,7 +22791,6 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
22750
22791
|
"notification-output": system("notification delivery — reached through notifier devices and rules"),
|
|
22751
22792
|
"notification-rules": system("notification rules — authored on their own page"),
|
|
22752
22793
|
"oauth-integration": system(IDENTITY),
|
|
22753
|
-
"oidc-connections": system(IDENTITY),
|
|
22754
22794
|
"osd-manager": system(PIPELINE),
|
|
22755
22795
|
"pipeline-executor": system(PIPELINE),
|
|
22756
22796
|
"pipeline-orchestrator": system(PIPELINE),
|
|
@@ -54485,7 +54525,7 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
|
|
|
54485
54525
|
* or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
|
|
54486
54526
|
* clears it.
|
|
54487
54527
|
*/
|
|
54488
|
-
var ConfigSchemaPassthrough$
|
|
54528
|
+
var ConfigSchemaPassthrough$2 = custom();
|
|
54489
54529
|
var IntegrationInstanceIdSchema = string().min(1);
|
|
54490
54530
|
var IntegrationInstanceModeSchema = _enum(["single", "multiple"]);
|
|
54491
54531
|
/**
|
|
@@ -54531,7 +54571,16 @@ var IntegrationInstanceKindSchema = object({
|
|
|
54531
54571
|
/** Relative hub path to start an interactive account link of an instance of this kind. */
|
|
54532
54572
|
connectPath: string().min(1).optional(),
|
|
54533
54573
|
/** Relative hub path to disconnect that account. */
|
|
54534
|
-
disconnectPath: string().min(1).optional()
|
|
54574
|
+
disconnectPath: string().min(1).optional(),
|
|
54575
|
+
/**
|
|
54576
|
+
* Parts of the edit dialog the flat form cannot draw (a node picker, a model source), named by a
|
|
54577
|
+
* GENERIC widget id the client maps to a component; a client that knows none of them shows none.
|
|
54578
|
+
* `connection` widgets write connection values, `model` widgets own the model choice.
|
|
54579
|
+
*/
|
|
54580
|
+
widgets: array(object({
|
|
54581
|
+
id: string().min(1),
|
|
54582
|
+
placement: _enum(["connection", "model"])
|
|
54583
|
+
})).optional()
|
|
54535
54584
|
});
|
|
54536
54585
|
/**
|
|
54537
54586
|
* How devices of an instance are found. `none`: the operator adds them by hand; `lan`: the addon
|
|
@@ -54636,7 +54685,7 @@ var integrationInstancesCapability = {
|
|
|
54636
54685
|
id: IntegrationInstanceIdSchema.nullable(),
|
|
54637
54686
|
/** The kind of the create form (`id: null`) of a provider with several. */
|
|
54638
54687
|
kind: string().min(1).optional()
|
|
54639
|
-
}), ConfigSchemaPassthrough$
|
|
54688
|
+
}), ConfigSchemaPassthrough$2, { auth: "admin" }),
|
|
54640
54689
|
listInstances: method(_void(), array(IntegrationInstanceSchema).readonly(), { auth: "admin" }),
|
|
54641
54690
|
getInstance: method(object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), { auth: "admin" }),
|
|
54642
54691
|
/**
|
|
@@ -55587,12 +55636,12 @@ var LlmModelInfoSchema = object({
|
|
|
55587
55636
|
});
|
|
55588
55637
|
/**
|
|
55589
55638
|
* The provider-specific part of a profile, validated by the provider that owns
|
|
55590
|
-
* the kind (
|
|
55639
|
+
* the kind (saving an instance refuses what it does not accept). A field its
|
|
55591
55640
|
* `connectionSchema` declares `type: 'password'` is a secret: it is held in the
|
|
55592
55641
|
* keychain, never in the row, and reads back as the redaction marker.
|
|
55593
55642
|
*/
|
|
55594
55643
|
var LlmProviderConfigSchema = record(string(), unknown());
|
|
55595
|
-
|
|
55644
|
+
object({
|
|
55596
55645
|
id: string(),
|
|
55597
55646
|
name: string(),
|
|
55598
55647
|
/** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
|
|
@@ -55686,8 +55735,8 @@ var LlmProviderWidgetSchema = object({
|
|
|
55686
55735
|
/** ConfigUISchema tree passed through untyped on the wire (the
|
|
55687
55736
|
* notification-output `ConfigSchemaPassthrough` precedent at
|
|
55688
55737
|
* notification-output.cap.ts:151); the exported TS type re-tightens it. */
|
|
55689
|
-
var ConfigSchemaPassthrough$
|
|
55690
|
-
|
|
55738
|
+
var ConfigSchemaPassthrough$1 = unknown();
|
|
55739
|
+
object({
|
|
55691
55740
|
kind: LlmProfileKindSchema,
|
|
55692
55741
|
label: string(),
|
|
55693
55742
|
/** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
|
|
@@ -55695,9 +55744,9 @@ var LlmProfileKindDescriptorSchema = object({
|
|
|
55695
55744
|
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
55696
55745
|
addonId: string(),
|
|
55697
55746
|
/** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
|
|
55698
|
-
connectionSchema: ConfigSchemaPassthrough$
|
|
55747
|
+
connectionSchema: ConfigSchemaPassthrough$1,
|
|
55699
55748
|
/** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
|
|
55700
|
-
advancedSchema: ConfigSchemaPassthrough$
|
|
55749
|
+
advancedSchema: ConfigSchemaPassthrough$1.optional(),
|
|
55701
55750
|
/** The kind's defaults; a model from `listModels` may override any of them. */
|
|
55702
55751
|
features: LlmModelFeaturesSchema,
|
|
55703
55752
|
/** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
|
|
@@ -55826,20 +55875,7 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
|
|
|
55826
55875
|
}), method(object({
|
|
55827
55876
|
addonId: string().optional(),
|
|
55828
55877
|
requestId: string()
|
|
55829
|
-
}), _void(), { kind: "mutation" }), method(
|
|
55830
|
-
kind: "mutation",
|
|
55831
|
-
auth: "admin"
|
|
55832
|
-
}), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
|
|
55833
|
-
kind: "mutation",
|
|
55834
|
-
auth: "admin"
|
|
55835
|
-
}), method(ProfileRefInputSchema, _void(), {
|
|
55836
|
-
kind: "mutation",
|
|
55837
|
-
auth: "admin"
|
|
55838
|
-
}), method(ProfileRefInputSchema, LlmGenerateResultSchema, {
|
|
55839
|
-
kind: "mutation",
|
|
55840
|
-
auth: "admin",
|
|
55841
|
-
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
55842
|
-
}), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
|
|
55878
|
+
}), _void(), { kind: "mutation" }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
|
|
55843
55879
|
kind: "mutation",
|
|
55844
55880
|
auth: "admin"
|
|
55845
55881
|
}), method(object({}), array(LlmDefaultSchema)), method(object({
|
|
@@ -56834,20 +56870,7 @@ method(_void(), MeshStatusSchema), method(object({
|
|
|
56834
56870
|
/** Optional hostname override the host should advertise once joined. */
|
|
56835
56871
|
hostname: string().optional() }), object({
|
|
56836
56872
|
/** Authentication URL the operator should open in a browser. */
|
|
56837
|
-
loginUrl: string() }), { kind: "mutation" }), method(_void(), object({ left: literal(true) }), { kind: "mutation" }), method(_void(), object({ loggedOut: literal(true) }), { kind: "mutation" }), method(_void(), object({ peers: array(MeshPeerSchema).readonly() }))
|
|
56838
|
-
/** Optional auth key — when provided, probes the key validity
|
|
56839
|
-
* against the provider's API. Omit when already joined to
|
|
56840
|
-
* just ping the daemon. */
|
|
56841
|
-
authKey: string().optional() }), object({
|
|
56842
|
-
ok: boolean(),
|
|
56843
|
-
/** Provider-side identifier resolved by the probe (tailnet
|
|
56844
|
-
* name for Tailscale, network id for ZeroTier, etc.). */
|
|
56845
|
-
tenant: string().optional(),
|
|
56846
|
-
/** Daemon binary version, when reachable. */
|
|
56847
|
-
daemonVersion: string().optional(),
|
|
56848
|
-
/** Human-readable error when `ok: false`. */
|
|
56849
|
-
error: string().optional()
|
|
56850
|
-
}), { kind: "mutation" });
|
|
56873
|
+
loginUrl: string() }), { kind: "mutation" }), method(_void(), object({ left: literal(true) }), { kind: "mutation" }), method(_void(), object({ loggedOut: literal(true) }), { kind: "mutation" }), method(_void(), object({ peers: array(MeshPeerSchema).readonly() }));
|
|
56851
56874
|
object({
|
|
56852
56875
|
value: number().nullable().meta(readingMeta("device", { label: "Total" })),
|
|
56853
56876
|
lastFetchedAt: number()
|
|
@@ -66505,61 +66528,6 @@ var OauthIntegrationDescriptorSchema = object({
|
|
|
66505
66528
|
});
|
|
66506
66529
|
method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
|
|
66507
66530
|
/**
|
|
66508
|
-
* `oidc-connections` — CRUD for IdP rows under `auth-oidc` (D828 sibling).
|
|
66509
|
-
*
|
|
66510
|
-
* One hub-only singleton (`auth-oidc`). The Settings UI is a DataTable +
|
|
66511
|
-
* ItemFormDialog; there is no `editable-array` in `globalSettingsSchema`.
|
|
66512
|
-
* Operator-chosen `id` is the URL slug (`/addon/auth-oidc/<id>/…`) and is
|
|
66513
|
-
* immutable after create.
|
|
66514
|
-
*/
|
|
66515
|
-
var ConfigSchemaPassthrough$1 = unknown();
|
|
66516
|
-
var OidcConnectionSchema = object({
|
|
66517
|
-
id: string().min(1),
|
|
66518
|
-
displayName: string(),
|
|
66519
|
-
icon: string(),
|
|
66520
|
-
issuerUrl: string(),
|
|
66521
|
-
clientId: string(),
|
|
66522
|
-
/** Client id + secret present — never the secret value. */
|
|
66523
|
-
configured: boolean(),
|
|
66524
|
-
/**
|
|
66525
|
-
* Values for the connection form schema. `clientSecret` is a keychain
|
|
66526
|
-
* {@link SecretFieldView} or `null` / `''`, never plaintext (D789).
|
|
66527
|
-
*/
|
|
66528
|
-
formValues: record(string(), unknown()).optional()
|
|
66529
|
-
});
|
|
66530
|
-
/**
|
|
66531
|
-
* Patch one connection. Omitted or empty `clientSecret` keeps the stored
|
|
66532
|
-
* secret (D787). `{ $secretClear: true }` clears it. `id` is never renamed.
|
|
66533
|
-
*/
|
|
66534
|
-
var OidcConnectionUpdateInputSchema = object({
|
|
66535
|
-
id: string().min(1),
|
|
66536
|
-
displayName: string().min(1),
|
|
66537
|
-
icon: string().optional(),
|
|
66538
|
-
issuerUrl: string().optional(),
|
|
66539
|
-
clientId: string().optional(),
|
|
66540
|
-
clientSecret: union([string(), object({ $secretClear: literal(true) })]).optional(),
|
|
66541
|
-
redirectUri: string().optional(),
|
|
66542
|
-
scopes: string().optional(),
|
|
66543
|
-
usernameClaim: _enum([
|
|
66544
|
-
"preferred_username",
|
|
66545
|
-
"email",
|
|
66546
|
-
"sub"
|
|
66547
|
-
]).optional()
|
|
66548
|
-
});
|
|
66549
|
-
method(object({}), ConfigSchemaPassthrough$1, { auth: "admin" }), method(object({}), array(OidcConnectionSchema).readonly(), { auth: "admin" }), method(object({
|
|
66550
|
-
id: string().min(1).regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "id must be a lowercase slug"),
|
|
66551
|
-
displayName: string().min(1)
|
|
66552
|
-
}), object({ id: string() }), {
|
|
66553
|
-
kind: "mutation",
|
|
66554
|
-
auth: "admin"
|
|
66555
|
-
}), method(OidcConnectionUpdateInputSchema, object({ ok: literal(true) }), {
|
|
66556
|
-
kind: "mutation",
|
|
66557
|
-
auth: "admin"
|
|
66558
|
-
}), method(object({ id: string().min(1) }), object({ ok: literal(true) }), {
|
|
66559
|
-
kind: "mutation",
|
|
66560
|
-
auth: "admin"
|
|
66561
|
-
});
|
|
66562
|
-
/**
|
|
66563
66531
|
* Generic on-screen-display (video overlay) cap. Each camera exposes
|
|
66564
66532
|
* a firmware-defined list of overlays (channel name, timestamp,
|
|
66565
66533
|
* watermark, logo, …); the cap models them as a homogeneous array of
|
|
@@ -72745,21 +72713,6 @@ method(object({
|
|
|
72745
72713
|
*/
|
|
72746
72714
|
ttlSec: union([number().int().positive(), literal("never")]).optional()
|
|
72747
72715
|
}), object({ token: string() }), { auth: "admin" }), method(object({ token: string() }), SsoBridgeClaimsSchema.nullable(), { auth: "admin" });
|
|
72748
|
-
var ProviderListEntrySchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
72749
|
-
providerId: string().min(1),
|
|
72750
|
-
displayName: string().min(1),
|
|
72751
|
-
configSchema: unknown(),
|
|
72752
|
-
nodeLocal: boolean(),
|
|
72753
|
-
shouldSaveDiskSpace: literal(true),
|
|
72754
|
-
minFreePercent: number().min(0).max(100)
|
|
72755
|
-
}), object({
|
|
72756
|
-
providerId: string().min(1),
|
|
72757
|
-
displayName: string().min(1),
|
|
72758
|
-
configSchema: unknown(),
|
|
72759
|
-
nodeLocal: boolean(),
|
|
72760
|
-
shouldSaveDiskSpace: literal(false),
|
|
72761
|
-
minFreePercent: literal(null)
|
|
72762
|
-
})]);
|
|
72763
72716
|
method(object({
|
|
72764
72717
|
location: StorageLocationRefSchema,
|
|
72765
72718
|
relativePath: string()
|
|
@@ -72821,42 +72774,7 @@ method(object({
|
|
|
72821
72774
|
}), _instanceof(Uint8Array), { auth: "admin" }), method(object({ downloadId: string() }), _void(), {
|
|
72822
72775
|
kind: "mutation",
|
|
72823
72776
|
auth: "admin"
|
|
72824
|
-
}), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(
|
|
72825
|
-
createdAt: true,
|
|
72826
|
-
updatedAt: true
|
|
72827
|
-
}), StorageLocationSchema, {
|
|
72828
|
-
kind: "mutation",
|
|
72829
|
-
auth: "admin"
|
|
72830
|
-
}), method(object({
|
|
72831
|
-
id: string(),
|
|
72832
|
-
force: boolean().optional()
|
|
72833
|
-
}), _void(), {
|
|
72834
|
-
kind: "mutation",
|
|
72835
|
-
auth: "admin"
|
|
72836
|
-
}), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
|
|
72837
|
-
ok: boolean(),
|
|
72838
|
-
error: string().optional()
|
|
72839
|
-
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
72840
|
-
providerId: string(),
|
|
72841
|
-
/**
|
|
72842
|
-
* The location this config is an UNSAVED edit of, when there is one.
|
|
72843
|
-
*
|
|
72844
|
-
* `listLocations` replaces every declared secret with the redaction
|
|
72845
|
-
* sentinel, so the edit modal's form state holds the sentinel for any
|
|
72846
|
-
* credential the operator did not retype — and posting that here
|
|
72847
|
-
* without a way to resolve it makes the provider try to authenticate
|
|
72848
|
-
* as `__camstack_redacted__` and report the operator's own working
|
|
72849
|
-
* password as wrong. Given this id, the orchestrator restores each
|
|
72850
|
-
* sentinel from the stored config (same rule as `upsertLocation`)
|
|
72851
|
-
* before dispatching. Omitted by the "Add location" wizard, where
|
|
72852
|
-
* every value was typed just now and nothing is stored yet.
|
|
72853
|
-
*/
|
|
72854
|
-
locationId: string().optional(),
|
|
72855
|
-
config: record(string(), unknown())
|
|
72856
|
-
}), object({
|
|
72857
|
-
ok: boolean(),
|
|
72858
|
-
error: string().optional()
|
|
72859
|
-
}), { auth: "admin" });
|
|
72777
|
+
}), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(_void(), array(StorageDrainProgressSchema).readonly());
|
|
72860
72778
|
/** One table of the settings database. */
|
|
72861
72779
|
var StorageTableSchema = object({
|
|
72862
72780
|
/** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
|
|
@@ -80449,13 +80367,6 @@ Object.freeze({
|
|
|
80449
80367
|
access: "delete",
|
|
80450
80368
|
role: "admin"
|
|
80451
80369
|
},
|
|
80452
|
-
"llm.deleteProfile": {
|
|
80453
|
-
capName: "llm",
|
|
80454
|
-
capScope: "system",
|
|
80455
|
-
addonId: null,
|
|
80456
|
-
access: "delete",
|
|
80457
|
-
role: "admin"
|
|
80458
|
-
},
|
|
80459
80370
|
"llm.generate": {
|
|
80460
80371
|
capName: "llm",
|
|
80461
80372
|
capScope: "system",
|
|
@@ -80519,20 +80430,6 @@ Object.freeze({
|
|
|
80519
80430
|
access: "view",
|
|
80520
80431
|
role: "admin"
|
|
80521
80432
|
},
|
|
80522
|
-
"llm.listProfileKinds": {
|
|
80523
|
-
capName: "llm",
|
|
80524
|
-
capScope: "system",
|
|
80525
|
-
addonId: null,
|
|
80526
|
-
access: "view",
|
|
80527
|
-
role: "admin"
|
|
80528
|
-
},
|
|
80529
|
-
"llm.listProfiles": {
|
|
80530
|
-
capName: "llm",
|
|
80531
|
-
capScope: "system",
|
|
80532
|
-
addonId: null,
|
|
80533
|
-
access: "view",
|
|
80534
|
-
role: "admin"
|
|
80535
|
-
},
|
|
80536
80433
|
"llm.listRuntimeNodes": {
|
|
80537
80434
|
capName: "llm",
|
|
80538
80435
|
capScope: "system",
|
|
@@ -80540,13 +80437,6 @@ Object.freeze({
|
|
|
80540
80437
|
access: "view",
|
|
80541
80438
|
role: "admin"
|
|
80542
80439
|
},
|
|
80543
|
-
"llm.migrateRawSecrets": {
|
|
80544
|
-
capName: "llm",
|
|
80545
|
-
capScope: "system",
|
|
80546
|
-
addonId: null,
|
|
80547
|
-
access: "create",
|
|
80548
|
-
role: "admin"
|
|
80549
|
-
},
|
|
80550
80440
|
"llm.resolveModelRef": {
|
|
80551
80441
|
capName: "llm",
|
|
80552
80442
|
capScope: "system",
|
|
@@ -80575,20 +80465,6 @@ Object.freeze({
|
|
|
80575
80465
|
access: "create",
|
|
80576
80466
|
role: "admin"
|
|
80577
80467
|
},
|
|
80578
|
-
"llm.testProfile": {
|
|
80579
|
-
capName: "llm",
|
|
80580
|
-
capScope: "system",
|
|
80581
|
-
addonId: null,
|
|
80582
|
-
access: "create",
|
|
80583
|
-
role: "admin"
|
|
80584
|
-
},
|
|
80585
|
-
"llm.upsertProfile": {
|
|
80586
|
-
capName: "llm",
|
|
80587
|
-
capScope: "system",
|
|
80588
|
-
addonId: null,
|
|
80589
|
-
access: "create",
|
|
80590
|
-
role: "admin"
|
|
80591
|
-
},
|
|
80592
80468
|
"llmRuntime.appleAvailability": {
|
|
80593
80469
|
capName: "llm-runtime",
|
|
80594
80470
|
capScope: "system",
|
|
@@ -81093,13 +80969,6 @@ Object.freeze({
|
|
|
81093
80969
|
access: "create",
|
|
81094
80970
|
role: "admin"
|
|
81095
80971
|
},
|
|
81096
|
-
"meshNetwork.testConnection": {
|
|
81097
|
-
capName: "mesh-network",
|
|
81098
|
-
capScope: "system",
|
|
81099
|
-
addonId: null,
|
|
81100
|
-
access: "create",
|
|
81101
|
-
role: "admin"
|
|
81102
|
-
},
|
|
81103
80972
|
"meter.getStatus": {
|
|
81104
80973
|
capName: "meter",
|
|
81105
80974
|
capScope: "device",
|
|
@@ -81758,13 +81627,6 @@ Object.freeze({
|
|
|
81758
81627
|
access: "create",
|
|
81759
81628
|
role: "admin"
|
|
81760
81629
|
},
|
|
81761
|
-
"notificationOutput.deleteTarget": {
|
|
81762
|
-
capName: "notification-output",
|
|
81763
|
-
capScope: "system",
|
|
81764
|
-
addonId: null,
|
|
81765
|
-
access: "delete",
|
|
81766
|
-
role: "admin"
|
|
81767
|
-
},
|
|
81768
81630
|
"notificationOutput.discoverTargets": {
|
|
81769
81631
|
capName: "notification-output",
|
|
81770
81632
|
capScope: "system",
|
|
@@ -81772,13 +81634,6 @@ Object.freeze({
|
|
|
81772
81634
|
access: "view",
|
|
81773
81635
|
role: "admin"
|
|
81774
81636
|
},
|
|
81775
|
-
"notificationOutput.getTarget": {
|
|
81776
|
-
capName: "notification-output",
|
|
81777
|
-
capScope: "system",
|
|
81778
|
-
addonId: null,
|
|
81779
|
-
access: "view",
|
|
81780
|
-
role: "admin"
|
|
81781
|
-
},
|
|
81782
81637
|
"notificationOutput.listTargetKinds": {
|
|
81783
81638
|
capName: "notification-output",
|
|
81784
81639
|
capScope: "system",
|
|
@@ -81786,13 +81641,6 @@ Object.freeze({
|
|
|
81786
81641
|
access: "view",
|
|
81787
81642
|
role: "admin"
|
|
81788
81643
|
},
|
|
81789
|
-
"notificationOutput.listTargets": {
|
|
81790
|
-
capName: "notification-output",
|
|
81791
|
-
capScope: "system",
|
|
81792
|
-
addonId: null,
|
|
81793
|
-
access: "view",
|
|
81794
|
-
role: "admin"
|
|
81795
|
-
},
|
|
81796
81644
|
"notificationOutput.probeTargetConfig": {
|
|
81797
81645
|
capName: "notification-output",
|
|
81798
81646
|
capScope: "system",
|
|
@@ -81807,13 +81655,6 @@ Object.freeze({
|
|
|
81807
81655
|
access: "create",
|
|
81808
81656
|
role: "admin"
|
|
81809
81657
|
},
|
|
81810
|
-
"notificationOutput.setTargetEnabled": {
|
|
81811
|
-
capName: "notification-output",
|
|
81812
|
-
capScope: "system",
|
|
81813
|
-
addonId: null,
|
|
81814
|
-
access: "create",
|
|
81815
|
-
role: "admin"
|
|
81816
|
-
},
|
|
81817
81658
|
"notificationOutput.testTarget": {
|
|
81818
81659
|
capName: "notification-output",
|
|
81819
81660
|
capScope: "system",
|
|
@@ -81821,13 +81662,6 @@ Object.freeze({
|
|
|
81821
81662
|
access: "create",
|
|
81822
81663
|
role: "admin"
|
|
81823
81664
|
},
|
|
81824
|
-
"notificationOutput.upsertTarget": {
|
|
81825
|
-
capName: "notification-output",
|
|
81826
|
-
capScope: "system",
|
|
81827
|
-
addonId: null,
|
|
81828
|
-
access: "create",
|
|
81829
|
-
role: "admin"
|
|
81830
|
-
},
|
|
81831
81665
|
"notificationRules.activateAlarmProfile": {
|
|
81832
81666
|
capName: "notification-rules",
|
|
81833
81667
|
capScope: "system",
|
|
@@ -82087,41 +81921,6 @@ Object.freeze({
|
|
|
82087
81921
|
access: "view",
|
|
82088
81922
|
role: "admin"
|
|
82089
81923
|
},
|
|
82090
|
-
"oidcConnections.connectionFormSchema": {
|
|
82091
|
-
capName: "oidc-connections",
|
|
82092
|
-
capScope: "system",
|
|
82093
|
-
addonId: null,
|
|
82094
|
-
access: "view",
|
|
82095
|
-
role: "admin"
|
|
82096
|
-
},
|
|
82097
|
-
"oidcConnections.createConnection": {
|
|
82098
|
-
capName: "oidc-connections",
|
|
82099
|
-
capScope: "system",
|
|
82100
|
-
addonId: null,
|
|
82101
|
-
access: "create",
|
|
82102
|
-
role: "admin"
|
|
82103
|
-
},
|
|
82104
|
-
"oidcConnections.deleteConnection": {
|
|
82105
|
-
capName: "oidc-connections",
|
|
82106
|
-
capScope: "system",
|
|
82107
|
-
addonId: null,
|
|
82108
|
-
access: "delete",
|
|
82109
|
-
role: "admin"
|
|
82110
|
-
},
|
|
82111
|
-
"oidcConnections.listConnections": {
|
|
82112
|
-
capName: "oidc-connections",
|
|
82113
|
-
capScope: "system",
|
|
82114
|
-
addonId: null,
|
|
82115
|
-
access: "view",
|
|
82116
|
-
role: "admin"
|
|
82117
|
-
},
|
|
82118
|
-
"oidcConnections.updateConnection": {
|
|
82119
|
-
capName: "oidc-connections",
|
|
82120
|
-
capScope: "system",
|
|
82121
|
-
addonId: null,
|
|
82122
|
-
access: "create",
|
|
82123
|
-
role: "admin"
|
|
82124
|
-
},
|
|
82125
81924
|
"osd.getStatus": {
|
|
82126
81925
|
capName: "osd",
|
|
82127
81926
|
capScope: "device",
|
|
@@ -85153,13 +84952,6 @@ Object.freeze({
|
|
|
85153
84952
|
access: "delete",
|
|
85154
84953
|
role: "admin"
|
|
85155
84954
|
},
|
|
85156
|
-
"storage.deleteLocation": {
|
|
85157
|
-
capName: "storage",
|
|
85158
|
-
capScope: "system",
|
|
85159
|
-
addonId: null,
|
|
85160
|
-
access: "delete",
|
|
85161
|
-
role: "admin"
|
|
85162
|
-
},
|
|
85163
84955
|
"storage.endDownload": {
|
|
85164
84956
|
capName: "storage",
|
|
85165
84957
|
capScope: "system",
|
|
@@ -85216,13 +85008,6 @@ Object.freeze({
|
|
|
85216
85008
|
access: "view",
|
|
85217
85009
|
role: "admin"
|
|
85218
85010
|
},
|
|
85219
|
-
"storage.listProviders": {
|
|
85220
|
-
capName: "storage",
|
|
85221
|
-
capScope: "system",
|
|
85222
|
-
addonId: null,
|
|
85223
|
-
access: "view",
|
|
85224
|
-
role: "admin"
|
|
85225
|
-
},
|
|
85226
85011
|
"storage.read": {
|
|
85227
85012
|
capName: "storage",
|
|
85228
85013
|
capScope: "system",
|
|
@@ -85244,27 +85029,6 @@ Object.freeze({
|
|
|
85244
85029
|
access: "view",
|
|
85245
85030
|
role: "admin"
|
|
85246
85031
|
},
|
|
85247
|
-
"storage.testConfig": {
|
|
85248
|
-
capName: "storage",
|
|
85249
|
-
capScope: "system",
|
|
85250
|
-
addonId: null,
|
|
85251
|
-
access: "view",
|
|
85252
|
-
role: "admin"
|
|
85253
|
-
},
|
|
85254
|
-
"storage.testLocation": {
|
|
85255
|
-
capName: "storage",
|
|
85256
|
-
capScope: "system",
|
|
85257
|
-
addonId: null,
|
|
85258
|
-
access: "view",
|
|
85259
|
-
role: "admin"
|
|
85260
|
-
},
|
|
85261
|
-
"storage.upsertLocation": {
|
|
85262
|
-
capName: "storage",
|
|
85263
|
-
capScope: "system",
|
|
85264
|
-
addonId: null,
|
|
85265
|
-
access: "create",
|
|
85266
|
-
role: "admin"
|
|
85267
|
-
},
|
|
85268
85032
|
"storage.write": {
|
|
85269
85033
|
capName: "storage",
|
|
85270
85034
|
capScope: "system",
|
|
@@ -91817,222 +91581,6 @@ var GoogleBrokerRegistry = class {
|
|
|
91817
91581
|
}
|
|
91818
91582
|
};
|
|
91819
91583
|
//#endregion
|
|
91820
|
-
//#region src/google-settings-copy.ts
|
|
91821
|
-
/**
|
|
91822
|
-
* Operator-facing setup copy for Connectivity → Calendars / Email.
|
|
91823
|
-
* Keep Connect as a same-origin relative link so the admin session cookie
|
|
91824
|
-
* rides along (an absolute Public URL from a LAN admin tab drops the cookie).
|
|
91825
|
-
* Root-relative hrefs must survive `sanitizeInfoHtml` in ui-library.
|
|
91826
|
-
*/
|
|
91827
|
-
/** Enable APIs library in Google Cloud Console. */
|
|
91828
|
-
var GOOGLE_CONSOLE_APIS_URL = "https://console.cloud.google.com/apis/library";
|
|
91829
|
-
/** Create / manage OAuth Web clients. */
|
|
91830
|
-
var GOOGLE_CONSOLE_CREDENTIALS_URL = "https://console.cloud.google.com/apis/credentials";
|
|
91831
|
-
function redirectUriDisplay(publicOrigin) {
|
|
91832
|
-
if (publicOrigin === null || publicOrigin.length === 0) return `<public-hub>${OAUTH_CALLBACK_SUFFIX}`;
|
|
91833
|
-
return `${publicOrigin.replace(/\/$/, "")}${OAUTH_CALLBACK_SUFFIX}`;
|
|
91834
|
-
}
|
|
91835
|
-
function consoleLinksHtml$1() {
|
|
91836
|
-
return [
|
|
91837
|
-
`<a href="${GOOGLE_CONSOLE_APIS_URL}">API library</a>`,
|
|
91838
|
-
` · `,
|
|
91839
|
-
`<a href="${GOOGLE_CONSOLE_CREDENTIALS_URL}">Credentials</a>`
|
|
91840
|
-
].join("");
|
|
91841
|
-
}
|
|
91842
|
-
function introHtml(cap, publicOrigin) {
|
|
91843
|
-
const redirect = escapeHtml$1(redirectUriDisplay(publicOrigin));
|
|
91844
|
-
const console = consoleLinksHtml$1();
|
|
91845
|
-
if (cap === "smtp-provider") return [
|
|
91846
|
-
"<ol>",
|
|
91847
|
-
`<li>Open Google Cloud Console (${console}) and enable the <strong>Gmail API</strong> (and Calendar API if you also use Calendars).</li>`,
|
|
91848
|
-
"<li>Under Credentials, create an OAuth client of type <strong>Web application</strong>.</li>",
|
|
91849
|
-
`<li>Add this authorized redirect URI (Network → <strong>Public endpoint</strong>, not Internal): <code>${redirect}</code></li>`,
|
|
91850
|
-
"<li>Paste Client ID and Client secret below, then <strong>Save</strong>.</li>",
|
|
91851
|
-
`<li>Open <a href="${OAUTH_START_PATH}">Connect Google</a> while signed in as admin (same browser tab as this hub).</li>`,
|
|
91852
|
-
"<li>Set From address (connected account or a verified send-as). Turn this integration off with the page <strong>Enable</strong> toggle when you do not want Gmail send — Calendar can stay connected.</li>",
|
|
91853
|
-
"</ol>"
|
|
91854
|
-
].join("");
|
|
91855
|
-
if (cap === "calendar-source") return [
|
|
91856
|
-
"<ol>",
|
|
91857
|
-
`<li>Open Google Cloud Console (${console}) and enable the <strong>Google Calendar API</strong> (and Gmail API if you also use Email).</li>`,
|
|
91858
|
-
"<li>Under Credentials, create an OAuth client of type <strong>Web application</strong>.</li>",
|
|
91859
|
-
`<li>Add this authorized redirect URI (Network → <strong>Public endpoint</strong>, not Internal): <code>${redirect}</code></li>`,
|
|
91860
|
-
"<li>Paste Client ID and Client secret below, then <strong>Save</strong>.</li>",
|
|
91861
|
-
`<li>Open <a href="${OAUTH_START_PATH}">Connect Google</a> while signed in as admin (same browser tab as this hub).</li>`,
|
|
91862
|
-
"<li>Optionally restrict which calendars are exposed with the filter below.</li>",
|
|
91863
|
-
"</ol>"
|
|
91864
|
-
].join("");
|
|
91865
|
-
return [
|
|
91866
|
-
"<ol>",
|
|
91867
|
-
`<li>Open Google Cloud Console (${console}) and enable <strong>Google Calendar API</strong> and <strong>Gmail API</strong>.</li>`,
|
|
91868
|
-
"<li>Create a <strong>Web application</strong> OAuth client under Credentials.</li>",
|
|
91869
|
-
`<li>Register redirect URI: <code>${redirect}</code> (Network → Public endpoint).</li>`,
|
|
91870
|
-
`<li>Paste Client ID / secret, Save, then <a href="${OAUTH_START_PATH}">Connect Google</a>.</li>`,
|
|
91871
|
-
"<li>Calendars and Email share one Google account; use each page’s <strong>Enable</strong> toggle to turn a capability off without revoking OAuth.</li>",
|
|
91872
|
-
"</ol>"
|
|
91873
|
-
].join("");
|
|
91874
|
-
}
|
|
91875
|
-
function connectHtml(cap, publicOrigin) {
|
|
91876
|
-
const redirect = escapeHtml$1(redirectUriDisplay(publicOrigin));
|
|
91877
|
-
if (cap === "smtp-provider") return [
|
|
91878
|
-
`After Save, open <a href="${OAUTH_START_PATH}">Connect Google</a> in this hub (admin session required). `,
|
|
91879
|
-
"Connect requests <code>gmail.send</code> (and Calendar read for the Calendars page). ",
|
|
91880
|
-
`Google must list exactly: <code>${redirect}</code>. `,
|
|
91881
|
-
"If an older Connect predates Gmail send, revoke CamStack in Google Account → Security and Connect again. ",
|
|
91882
|
-
`Console: ${consoleLinksHtml$1()}.`
|
|
91883
|
-
].join("");
|
|
91884
|
-
if (cap === "calendar-source") return [
|
|
91885
|
-
`After Save, open <a href="${OAUTH_START_PATH}">Connect Google</a> in this hub (admin session required). `,
|
|
91886
|
-
"Connect requests <code>calendar.readonly</code> (and Gmail send for the Email page). ",
|
|
91887
|
-
`Google must list exactly: <code>${redirect}</code>. `,
|
|
91888
|
-
`Console: ${consoleLinksHtml$1()}.`
|
|
91889
|
-
].join("");
|
|
91890
|
-
return [
|
|
91891
|
-
`After Save, open <a href="${OAUTH_START_PATH}">Connect Google</a>. `,
|
|
91892
|
-
`Redirect URI registered in Google Cloud must be <code>${redirect}</code>. `,
|
|
91893
|
-
`Console: ${consoleLinksHtml$1()}.`
|
|
91894
|
-
].join("");
|
|
91895
|
-
}
|
|
91896
|
-
function escapeHtml$1(s) {
|
|
91897
|
-
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
91898
|
-
}
|
|
91899
|
-
//#endregion
|
|
91900
|
-
//#region src/google-broker-settings-schema.ts
|
|
91901
|
-
/**
|
|
91902
|
-
* Per-kind broker creation/edit form for kind=`google`.
|
|
91903
|
-
* Account linking (Sign in) is driven by the kind's `connectPath`
|
|
91904
|
-
* on the instances page — not a hard-coded Connect link in this form.
|
|
91905
|
-
*/
|
|
91906
|
-
function consoleLinksHtml() {
|
|
91907
|
-
return [
|
|
91908
|
-
`<a href="${GOOGLE_CONSOLE_APIS_URL}">API library</a>`,
|
|
91909
|
-
` · `,
|
|
91910
|
-
`<a href="${GOOGLE_CONSOLE_CREDENTIALS_URL}">Credentials</a>`
|
|
91911
|
-
].join("");
|
|
91912
|
-
}
|
|
91913
|
-
/** Setup steps shown on Add / Edit — includes Audience / Test users. */
|
|
91914
|
-
function googleBrokerSetupHtml(publicOrigin) {
|
|
91915
|
-
const redirect = escapeHtml(redirectUriDisplay(publicOrigin));
|
|
91916
|
-
return [
|
|
91917
|
-
"<ol>",
|
|
91918
|
-
`<li>Open Google Cloud Console (${consoleLinksHtml()}). Create a <strong>new project</strong> (or pick an existing one) from the project picker at the top.</li>`,
|
|
91919
|
-
"<li>In that project, enable <strong>Google Calendar API</strong> and/or <strong>Gmail API</strong> (API library).</li>",
|
|
91920
|
-
"<li>Open <strong>Google Auth Platform → Audience</strong> (or APIs & Services → OAuth consent screen → <strong>Audience</strong>). User type <strong>External</strong> + publishing status <strong>Testing</strong> is fine for a personal hub. Under <strong>Test users</strong>, add the Google account(s) that will Sign in — otherwise Google returns <code>403: access_denied</code>. (If you only see Branding / Data Access, open the <strong>Audience</strong> tab in the left sidebar of Google Auth Platform.) Publishing / verification is optional for a private hub.</li>",
|
|
91921
|
-
"<li>Under Credentials, create an OAuth client of type <strong>Web application</strong>.</li>",
|
|
91922
|
-
`<li>Add this authorized redirect URI (Network → <strong>Public endpoint</strong>, not Internal): <code>${redirect}</code></li>`,
|
|
91923
|
-
"<li>Paste Client ID and Client secret below. <strong>Test connection</strong> checks those with Google (not the account yet).</li>",
|
|
91924
|
-
"<li>Add the broker — the hub then opens Google sign-in in a popup to link the account (Calendar + Gmail). Use <strong>Sign in</strong> on the row if you skip or cancel.</li>",
|
|
91925
|
-
"</ol>"
|
|
91926
|
-
].join("");
|
|
91927
|
-
}
|
|
91928
|
-
function buildGoogleBrokerSettingsSchema(publicOrigin) {
|
|
91929
|
-
return { sections: [
|
|
91930
|
-
{
|
|
91931
|
-
id: "setup-intro",
|
|
91932
|
-
title: "Setup",
|
|
91933
|
-
titleKey: "google-services:googleBrokerSettings.s_setup-intro.title",
|
|
91934
|
-
description: "Google Cloud Console — register the hub redirect before Add / Sign in.",
|
|
91935
|
-
descriptionKey: "google-services:googleBrokerSettings.s_setup-intro.description",
|
|
91936
|
-
columns: 1,
|
|
91937
|
-
fields: [{
|
|
91938
|
-
type: "info",
|
|
91939
|
-
key: "_setupSteps",
|
|
91940
|
-
label: "Steps",
|
|
91941
|
-
labelKey: "google-services:googleBrokerSettings.s_setup-intro._setupSteps.label",
|
|
91942
|
-
format: "html",
|
|
91943
|
-
content: googleBrokerSetupHtml(publicOrigin)
|
|
91944
|
-
}]
|
|
91945
|
-
},
|
|
91946
|
-
{
|
|
91947
|
-
id: "google-oauth-client",
|
|
91948
|
-
title: "Google OAuth client",
|
|
91949
|
-
titleKey: "google-services:googleBrokerSettings.s_google-oauth-client.title",
|
|
91950
|
-
description: "Web application client from Google Cloud Console. The same Cloud project can be reused across Google brokers.",
|
|
91951
|
-
descriptionKey: "google-services:googleBrokerSettings.s_google-oauth-client.description",
|
|
91952
|
-
columns: 1,
|
|
91953
|
-
fields: [{
|
|
91954
|
-
type: "text",
|
|
91955
|
-
key: "clientId",
|
|
91956
|
-
label: "Client ID",
|
|
91957
|
-
labelKey: "google-services:googleBrokerSettings.s_google-oauth-client.clientId.label"
|
|
91958
|
-
}, {
|
|
91959
|
-
type: "password",
|
|
91960
|
-
key: "clientSecret",
|
|
91961
|
-
label: "Client secret",
|
|
91962
|
-
labelKey: "google-services:googleBrokerSettings.s_google-oauth-client.clientSecret.label",
|
|
91963
|
-
showToggle: true
|
|
91964
|
-
}]
|
|
91965
|
-
},
|
|
91966
|
-
{
|
|
91967
|
-
id: "gmail-send",
|
|
91968
|
-
title: "Gmail send",
|
|
91969
|
-
titleKey: "google-services:googleBrokerSettings.s_gmail-send.title",
|
|
91970
|
-
description: "From must be this connected account or a verified send-as. Disable Email on Connectivity to turn Gmail off without removing the broker.",
|
|
91971
|
-
descriptionKey: "google-services:googleBrokerSettings.s_gmail-send.description",
|
|
91972
|
-
columns: 1,
|
|
91973
|
-
fields: [{
|
|
91974
|
-
type: "text",
|
|
91975
|
-
key: "fromAddress",
|
|
91976
|
-
label: "From address",
|
|
91977
|
-
labelKey: "google-services:googleBrokerSettings.s_gmail-send.fromAddress.label",
|
|
91978
|
-
description: "Defaults to the connected Google account email when empty.",
|
|
91979
|
-
descriptionKey: "google-services:googleBrokerSettings.s_gmail-send.fromAddress.description"
|
|
91980
|
-
}, {
|
|
91981
|
-
type: "text",
|
|
91982
|
-
key: "fromName",
|
|
91983
|
-
label: "From display name (optional)",
|
|
91984
|
-
labelKey: "google-services:googleBrokerSettings.s_gmail-send.fromName.label"
|
|
91985
|
-
}]
|
|
91986
|
-
}
|
|
91987
|
-
] };
|
|
91988
|
-
}
|
|
91989
|
-
/** Connectivity Calendars / Email pages — the calendar import picker is on each broker. */
|
|
91990
|
-
function buildGoogleFeatureSettingsSchema(cap, publicOrigin) {
|
|
91991
|
-
const redirect = escapeHtml(redirectUriDisplay(publicOrigin));
|
|
91992
|
-
if (cap === "calendar-source") return { sections: [{
|
|
91993
|
-
id: "setup-intro",
|
|
91994
|
-
title: "Google brokers",
|
|
91995
|
-
titleKey: "google-services:googleFeatureSettings.s_setup-intro.title",
|
|
91996
|
-
columns: 1,
|
|
91997
|
-
fields: [{
|
|
91998
|
-
type: "info",
|
|
91999
|
-
key: "_setupSteps",
|
|
92000
|
-
label: "Setup",
|
|
92001
|
-
labelKey: "google-services:googleFeatureSettings.s_setup-intro._setupSteps.label",
|
|
92002
|
-
format: "html",
|
|
92003
|
-
content: [
|
|
92004
|
-
"<p>Link a Google account under Connectivity → <strong>Brokers</strong> ",
|
|
92005
|
-
"(Client ID / secret + Sign in), then add a calendar under Connectivity → <strong>Calendars</strong>. ",
|
|
92006
|
-
`OAuth redirect URI: <code>${redirect}</code>.</p>`
|
|
92007
|
-
].join("")
|
|
92008
|
-
}]
|
|
92009
|
-
}] };
|
|
92010
|
-
return { sections: [{
|
|
92011
|
-
id: "setup-intro",
|
|
92012
|
-
title: cap === "smtp-provider" ? "Gmail send uses Google brokers" : "Google brokers",
|
|
92013
|
-
columns: 1,
|
|
92014
|
-
fields: [{
|
|
92015
|
-
type: "info",
|
|
92016
|
-
key: "_setupSteps",
|
|
92017
|
-
label: "Setup",
|
|
92018
|
-
labelKey: "google-services:googleFeatureSettings._setupSteps.label",
|
|
92019
|
-
format: "html",
|
|
92020
|
-
content: cap === "smtp-provider" ? [
|
|
92021
|
-
"<p>Add or edit a <strong>Google</strong> broker under Connectivity → <strong>Brokers</strong> ",
|
|
92022
|
-
"(Client ID / secret + Sign in). From address and send-as live on that broker. ",
|
|
92023
|
-
`OAuth redirect URI: <code>${redirect}</code>.</p>`
|
|
92024
|
-
].join("") : [
|
|
92025
|
-
"<p>Add or edit a <strong>Google</strong> broker under Connectivity → <strong>Brokers</strong> ",
|
|
92026
|
-
"(Client ID / secret + Sign in). ",
|
|
92027
|
-
`OAuth redirect URI: <code>${redirect}</code>.</p>`
|
|
92028
|
-
].join("")
|
|
92029
|
-
}]
|
|
92030
|
-
}] };
|
|
92031
|
-
}
|
|
92032
|
-
function escapeHtml(s) {
|
|
92033
|
-
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
92034
|
-
}
|
|
92035
|
-
//#endregion
|
|
92036
91584
|
//#region src/google-calendar-source.ts
|
|
92037
91585
|
function parseGoogleInstant(value) {
|
|
92038
91586
|
const ms = Date.parse(value);
|
|
@@ -92553,6 +92101,179 @@ function buildGoogleCalendarInstances(records, deps) {
|
|
|
92553
92101
|
});
|
|
92554
92102
|
}
|
|
92555
92103
|
//#endregion
|
|
92104
|
+
//#region src/google-settings-copy.ts
|
|
92105
|
+
/**
|
|
92106
|
+
* Operator-facing setup copy for Connectivity → Calendars / Email.
|
|
92107
|
+
* Keep Connect as a same-origin relative link so the admin session cookie
|
|
92108
|
+
* rides along (an absolute Public URL from a LAN admin tab drops the cookie).
|
|
92109
|
+
* Root-relative hrefs must survive `sanitizeInfoHtml` in ui-library.
|
|
92110
|
+
*/
|
|
92111
|
+
/** Enable APIs library in Google Cloud Console. */
|
|
92112
|
+
var GOOGLE_CONSOLE_APIS_URL = "https://console.cloud.google.com/apis/library";
|
|
92113
|
+
/** Create / manage OAuth Web clients. */
|
|
92114
|
+
var GOOGLE_CONSOLE_CREDENTIALS_URL = "https://console.cloud.google.com/apis/credentials";
|
|
92115
|
+
function redirectUriDisplay(publicOrigin) {
|
|
92116
|
+
if (publicOrigin === null || publicOrigin.length === 0) return `<public-hub>${OAUTH_CALLBACK_SUFFIX}`;
|
|
92117
|
+
return `${publicOrigin.replace(/\/$/, "")}${OAUTH_CALLBACK_SUFFIX}`;
|
|
92118
|
+
}
|
|
92119
|
+
function consoleLinksHtml$1() {
|
|
92120
|
+
return [
|
|
92121
|
+
`<a href="${GOOGLE_CONSOLE_APIS_URL}">API library</a>`,
|
|
92122
|
+
` · `,
|
|
92123
|
+
`<a href="${GOOGLE_CONSOLE_CREDENTIALS_URL}">Credentials</a>`
|
|
92124
|
+
].join("");
|
|
92125
|
+
}
|
|
92126
|
+
function introHtml(cap, publicOrigin) {
|
|
92127
|
+
const redirect = escapeHtml$1(redirectUriDisplay(publicOrigin));
|
|
92128
|
+
const console = consoleLinksHtml$1();
|
|
92129
|
+
if (cap === "smtp-provider") return [
|
|
92130
|
+
"<ol>",
|
|
92131
|
+
`<li>Open Google Cloud Console (${console}) and enable the <strong>Gmail API</strong> (and Calendar API if you also use Calendars).</li>`,
|
|
92132
|
+
"<li>Under Credentials, create an OAuth client of type <strong>Web application</strong>.</li>",
|
|
92133
|
+
`<li>Add this authorized redirect URI (Network → <strong>Public endpoint</strong>, not Internal): <code>${redirect}</code></li>`,
|
|
92134
|
+
"<li>Paste Client ID and Client secret below, then <strong>Save</strong>.</li>",
|
|
92135
|
+
`<li>Open <a href="${OAUTH_START_PATH}">Connect Google</a> while signed in as admin (same browser tab as this hub).</li>`,
|
|
92136
|
+
"<li>Set From address (connected account or a verified send-as). Turn this integration off with the page <strong>Enable</strong> toggle when you do not want Gmail send — Calendar can stay connected.</li>",
|
|
92137
|
+
"</ol>"
|
|
92138
|
+
].join("");
|
|
92139
|
+
if (cap === "calendar-source") return [
|
|
92140
|
+
"<ol>",
|
|
92141
|
+
`<li>Open Google Cloud Console (${console}) and enable the <strong>Google Calendar API</strong> (and Gmail API if you also use Email).</li>`,
|
|
92142
|
+
"<li>Under Credentials, create an OAuth client of type <strong>Web application</strong>.</li>",
|
|
92143
|
+
`<li>Add this authorized redirect URI (Network → <strong>Public endpoint</strong>, not Internal): <code>${redirect}</code></li>`,
|
|
92144
|
+
"<li>Paste Client ID and Client secret below, then <strong>Save</strong>.</li>",
|
|
92145
|
+
`<li>Open <a href="${OAUTH_START_PATH}">Connect Google</a> while signed in as admin (same browser tab as this hub).</li>`,
|
|
92146
|
+
"<li>Optionally restrict which calendars are exposed with the filter below.</li>",
|
|
92147
|
+
"</ol>"
|
|
92148
|
+
].join("");
|
|
92149
|
+
return [
|
|
92150
|
+
"<ol>",
|
|
92151
|
+
`<li>Open Google Cloud Console (${console}) and enable <strong>Google Calendar API</strong> and <strong>Gmail API</strong>.</li>`,
|
|
92152
|
+
"<li>Create a <strong>Web application</strong> OAuth client under Credentials.</li>",
|
|
92153
|
+
`<li>Register redirect URI: <code>${redirect}</code> (Network → Public endpoint).</li>`,
|
|
92154
|
+
`<li>Paste Client ID / secret, Save, then <a href="${OAUTH_START_PATH}">Connect Google</a>.</li>`,
|
|
92155
|
+
"<li>Calendars and Email share one Google account; use each page’s <strong>Enable</strong> toggle to turn a capability off without revoking OAuth.</li>",
|
|
92156
|
+
"</ol>"
|
|
92157
|
+
].join("");
|
|
92158
|
+
}
|
|
92159
|
+
function connectHtml(cap, publicOrigin) {
|
|
92160
|
+
const redirect = escapeHtml$1(redirectUriDisplay(publicOrigin));
|
|
92161
|
+
if (cap === "smtp-provider") return [
|
|
92162
|
+
`After Save, open <a href="${OAUTH_START_PATH}">Connect Google</a> in this hub (admin session required). `,
|
|
92163
|
+
"Connect requests <code>gmail.send</code> (and Calendar read for the Calendars page). ",
|
|
92164
|
+
`Google must list exactly: <code>${redirect}</code>. `,
|
|
92165
|
+
"If an older Connect predates Gmail send, revoke CamStack in Google Account → Security and Connect again. ",
|
|
92166
|
+
`Console: ${consoleLinksHtml$1()}.`
|
|
92167
|
+
].join("");
|
|
92168
|
+
if (cap === "calendar-source") return [
|
|
92169
|
+
`After Save, open <a href="${OAUTH_START_PATH}">Connect Google</a> in this hub (admin session required). `,
|
|
92170
|
+
"Connect requests <code>calendar.readonly</code> (and Gmail send for the Email page). ",
|
|
92171
|
+
`Google must list exactly: <code>${redirect}</code>. `,
|
|
92172
|
+
`Console: ${consoleLinksHtml$1()}.`
|
|
92173
|
+
].join("");
|
|
92174
|
+
return [
|
|
92175
|
+
`After Save, open <a href="${OAUTH_START_PATH}">Connect Google</a>. `,
|
|
92176
|
+
`Redirect URI registered in Google Cloud must be <code>${redirect}</code>. `,
|
|
92177
|
+
`Console: ${consoleLinksHtml$1()}.`
|
|
92178
|
+
].join("");
|
|
92179
|
+
}
|
|
92180
|
+
function escapeHtml$1(s) {
|
|
92181
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
92182
|
+
}
|
|
92183
|
+
//#endregion
|
|
92184
|
+
//#region src/google-broker-settings-schema.ts
|
|
92185
|
+
/**
|
|
92186
|
+
* Per-kind broker creation/edit form for kind=`google`.
|
|
92187
|
+
* Account linking (Sign in) is driven by the kind's `connectPath`
|
|
92188
|
+
* on the instances page — not a hard-coded Connect link in this form.
|
|
92189
|
+
*/
|
|
92190
|
+
function consoleLinksHtml() {
|
|
92191
|
+
return [
|
|
92192
|
+
`<a href="${GOOGLE_CONSOLE_APIS_URL}">API library</a>`,
|
|
92193
|
+
` · `,
|
|
92194
|
+
`<a href="${GOOGLE_CONSOLE_CREDENTIALS_URL}">Credentials</a>`
|
|
92195
|
+
].join("");
|
|
92196
|
+
}
|
|
92197
|
+
/** Setup steps shown on Add / Edit — includes Audience / Test users. */
|
|
92198
|
+
function googleBrokerSetupHtml(publicOrigin) {
|
|
92199
|
+
const redirect = escapeHtml(redirectUriDisplay(publicOrigin));
|
|
92200
|
+
return [
|
|
92201
|
+
"<ol>",
|
|
92202
|
+
`<li>Open Google Cloud Console (${consoleLinksHtml()}). Create a <strong>new project</strong> (or pick an existing one) from the project picker at the top.</li>`,
|
|
92203
|
+
"<li>In that project, enable <strong>Google Calendar API</strong> and/or <strong>Gmail API</strong> (API library).</li>",
|
|
92204
|
+
"<li>Open <strong>Google Auth Platform → Audience</strong> (or APIs & Services → OAuth consent screen → <strong>Audience</strong>). User type <strong>External</strong> + publishing status <strong>Testing</strong> is fine for a personal hub. Under <strong>Test users</strong>, add the Google account(s) that will Sign in — otherwise Google returns <code>403: access_denied</code>. (If you only see Branding / Data Access, open the <strong>Audience</strong> tab in the left sidebar of Google Auth Platform.) Publishing / verification is optional for a private hub.</li>",
|
|
92205
|
+
"<li>Under Credentials, create an OAuth client of type <strong>Web application</strong>.</li>",
|
|
92206
|
+
`<li>Add this authorized redirect URI (Network → <strong>Public endpoint</strong>, not Internal): <code>${redirect}</code></li>`,
|
|
92207
|
+
"<li>Paste Client ID and Client secret below. <strong>Test connection</strong> checks those with Google (not the account yet).</li>",
|
|
92208
|
+
"<li>Add the broker — the hub then opens Google sign-in in a popup to link the account (Calendar + Gmail). Use <strong>Sign in</strong> on the row if you skip or cancel.</li>",
|
|
92209
|
+
"</ol>"
|
|
92210
|
+
].join("");
|
|
92211
|
+
}
|
|
92212
|
+
function buildGoogleBrokerSettingsSchema(publicOrigin) {
|
|
92213
|
+
return { sections: [
|
|
92214
|
+
{
|
|
92215
|
+
id: "setup-intro",
|
|
92216
|
+
title: "Setup",
|
|
92217
|
+
titleKey: "google-services:googleBrokerSettings.s_setup-intro.title",
|
|
92218
|
+
description: "Google Cloud Console — register the hub redirect before Add / Sign in.",
|
|
92219
|
+
descriptionKey: "google-services:googleBrokerSettings.s_setup-intro.description",
|
|
92220
|
+
columns: 1,
|
|
92221
|
+
fields: [{
|
|
92222
|
+
type: "info",
|
|
92223
|
+
key: "_setupSteps",
|
|
92224
|
+
label: "Steps",
|
|
92225
|
+
labelKey: "google-services:googleBrokerSettings.s_setup-intro._setupSteps.label",
|
|
92226
|
+
format: "html",
|
|
92227
|
+
content: googleBrokerSetupHtml(publicOrigin)
|
|
92228
|
+
}]
|
|
92229
|
+
},
|
|
92230
|
+
{
|
|
92231
|
+
id: "google-oauth-client",
|
|
92232
|
+
title: "Google OAuth client",
|
|
92233
|
+
titleKey: "google-services:googleBrokerSettings.s_google-oauth-client.title",
|
|
92234
|
+
description: "Web application client from Google Cloud Console. The same Cloud project can be reused across Google brokers.",
|
|
92235
|
+
descriptionKey: "google-services:googleBrokerSettings.s_google-oauth-client.description",
|
|
92236
|
+
columns: 1,
|
|
92237
|
+
fields: [{
|
|
92238
|
+
type: "text",
|
|
92239
|
+
key: "clientId",
|
|
92240
|
+
label: "Client ID",
|
|
92241
|
+
labelKey: "google-services:googleBrokerSettings.s_google-oauth-client.clientId.label"
|
|
92242
|
+
}, {
|
|
92243
|
+
type: "password",
|
|
92244
|
+
key: "clientSecret",
|
|
92245
|
+
label: "Client secret",
|
|
92246
|
+
labelKey: "google-services:googleBrokerSettings.s_google-oauth-client.clientSecret.label",
|
|
92247
|
+
showToggle: true
|
|
92248
|
+
}]
|
|
92249
|
+
},
|
|
92250
|
+
{
|
|
92251
|
+
id: "gmail-send",
|
|
92252
|
+
title: "Gmail send",
|
|
92253
|
+
titleKey: "google-services:googleBrokerSettings.s_gmail-send.title",
|
|
92254
|
+
description: "From must be this connected account or a verified send-as. Disable Email on Connectivity to turn Gmail off without removing the broker.",
|
|
92255
|
+
descriptionKey: "google-services:googleBrokerSettings.s_gmail-send.description",
|
|
92256
|
+
columns: 1,
|
|
92257
|
+
fields: [{
|
|
92258
|
+
type: "text",
|
|
92259
|
+
key: "fromAddress",
|
|
92260
|
+
label: "From address",
|
|
92261
|
+
labelKey: "google-services:googleBrokerSettings.s_gmail-send.fromAddress.label",
|
|
92262
|
+
description: "Defaults to the connected Google account email when empty.",
|
|
92263
|
+
descriptionKey: "google-services:googleBrokerSettings.s_gmail-send.fromAddress.description"
|
|
92264
|
+
}, {
|
|
92265
|
+
type: "text",
|
|
92266
|
+
key: "fromName",
|
|
92267
|
+
label: "From display name (optional)",
|
|
92268
|
+
labelKey: "google-services:googleBrokerSettings.s_gmail-send.fromName.label"
|
|
92269
|
+
}]
|
|
92270
|
+
}
|
|
92271
|
+
] };
|
|
92272
|
+
}
|
|
92273
|
+
function escapeHtml(s) {
|
|
92274
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
92275
|
+
}
|
|
92276
|
+
//#endregion
|
|
92556
92277
|
//#region src/google-instances.ts
|
|
92557
92278
|
/**
|
|
92558
92279
|
* The Google accounts as `integration-instances` (planning#408 P3): one instance per broker
|
|
@@ -93839,21 +93560,6 @@ var GoogleServicesAddon = class extends BaseAddon {
|
|
|
93839
93560
|
this.publicOrigin = null;
|
|
93840
93561
|
}
|
|
93841
93562
|
}
|
|
93842
|
-
/**
|
|
93843
|
-
* Connectivity Calendars / Email: point at Brokers (no duplicate OAuth fields).
|
|
93844
|
-
* Addon page without cap: same pointer + note.
|
|
93845
|
-
*/
|
|
93846
|
-
globalSettingsSchema(cap) {
|
|
93847
|
-
const scoped = asSettingsCap(cap);
|
|
93848
|
-
return this.schema(buildGoogleFeatureSettingsSchema(scoped, this.publicOrigin));
|
|
93849
|
-
}
|
|
93850
|
-
async getGlobalSettings(overlay, cap, nodeId) {
|
|
93851
|
-
await this.refreshPublicOrigin();
|
|
93852
|
-
return super.getGlobalSettings(overlay, cap, nodeId);
|
|
93853
|
-
}
|
|
93854
93563
|
};
|
|
93855
|
-
function asSettingsCap(cap) {
|
|
93856
|
-
if (cap === "calendar-source" || cap === "smtp-provider") return cap;
|
|
93857
|
-
}
|
|
93858
93564
|
//#endregion
|
|
93859
|
-
export { GOOGLE_OAUTH_SCOPES as C, GoogleServicesAddon, GoogleServicesAddon as default, GOOGLE_GMAIL_SEND_SCOPE as S, OAUTH_START_PATH as T, GoogleBrokerRegistry as _,
|
|
93565
|
+
export { GOOGLE_OAUTH_SCOPES as C, GoogleServicesAddon, GoogleServicesAddon as default, GOOGLE_GMAIL_SEND_SCOPE as S, OAUTH_START_PATH as T, GoogleBrokerRegistry as _, redirectUriDisplay as a, DEFAULT_GOOGLE_CONFIG as b, exchangeCode as c, buildRawMime as d, createGmailSmtpProvider as f, mapGoogleEvent as g, createGoogleCalendarSource as h, introHtml as i, needsRefresh as l, createGoogleCalendarApi as m, GOOGLE_CONSOLE_CREDENTIALS_URL as n, applyTokenResponse as o, selectGmailAccount as p, connectHtml as r, buildAuthorizeUrl as s, GOOGLE_CONSOLE_APIS_URL as t, refreshAccessToken as u, parseStampedCalendarId as v, GoogleServicesConfigSchema as w, GOOGLE_BROKER_KIND as x, stampCalendarId as y };
|