@camstack/addon-google-services 0.1.3 → 0.1.4
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/google-services.addon.js +79 -53
- package/dist/google-services.addon.mjs +79 -53
- package/package.json +1 -1
|
@@ -53324,63 +53324,89 @@ var GoogleServicesAddon = class extends BaseAddon {
|
|
|
53324
53324
|
if (!origin) throw new Error("No hub public address available from local-network — set a Public endpoint on the Network page (OAuth2 redirects use that role, not Internal).");
|
|
53325
53325
|
return `${origin.replace(/\/$/, "")}/addon/${ADDON_ID}${CALLBACK_PATH}`;
|
|
53326
53326
|
}
|
|
53327
|
-
|
|
53328
|
-
|
|
53329
|
-
|
|
53330
|
-
|
|
53331
|
-
|
|
53332
|
-
|
|
53333
|
-
|
|
53334
|
-
|
|
53335
|
-
|
|
53336
|
-
|
|
53337
|
-
|
|
53338
|
-
|
|
53339
|
-
|
|
53340
|
-
|
|
53341
|
-
|
|
53342
|
-
|
|
53343
|
-
|
|
53344
|
-
|
|
53345
|
-
|
|
53327
|
+
/**
|
|
53328
|
+
* Connectivity asks for settings scoped to the page capability, so Calendar
|
|
53329
|
+
* and Email do not each redraw the other's fields (same pattern as
|
|
53330
|
+
* mqtt-broker under `broker`). The addon page (no cap) keeps every section.
|
|
53331
|
+
*/
|
|
53332
|
+
globalSettingsSchema(cap) {
|
|
53333
|
+
const schema = this.fullSettingsSchema();
|
|
53334
|
+
if (cap === "calendar-source") return {
|
|
53335
|
+
...schema,
|
|
53336
|
+
sections: schema.sections.filter((s) => s.id === "google-oauth" || s.id === "google-calendar")
|
|
53337
|
+
};
|
|
53338
|
+
if (cap === "smtp-provider") return {
|
|
53339
|
+
...schema,
|
|
53340
|
+
sections: schema.sections.filter((s) => s.id === "google-oauth" || s.id === "gmail-send")
|
|
53341
|
+
};
|
|
53342
|
+
return schema;
|
|
53343
|
+
}
|
|
53344
|
+
fullSettingsSchema() {
|
|
53345
|
+
return this.schema({ sections: [
|
|
53346
|
+
{
|
|
53347
|
+
id: "google-oauth",
|
|
53348
|
+
title: "Google account",
|
|
53349
|
+
description: "Create an OAuth client (Web application) in Google Cloud Console with the Calendar API and Gmail API enabled. Connect grants both Calendar read and Gmail send on the same account. Register the redirect URI `<public-hub>/addon/google-services/oauth/callback` — hub = Public endpoint from Network (same role as sign-in / OAuth2; Google rejects plain LAN http).",
|
|
53350
|
+
columns: 1,
|
|
53351
|
+
fields: [
|
|
53352
|
+
{
|
|
53353
|
+
type: "text",
|
|
53354
|
+
key: "clientId",
|
|
53355
|
+
label: "Client ID"
|
|
53356
|
+
},
|
|
53357
|
+
{
|
|
53358
|
+
type: "password",
|
|
53359
|
+
key: "clientSecret",
|
|
53360
|
+
label: "Client secret",
|
|
53361
|
+
showToggle: true
|
|
53362
|
+
},
|
|
53363
|
+
{
|
|
53364
|
+
type: "info",
|
|
53365
|
+
key: "_connectInfo",
|
|
53366
|
+
label: "Connect",
|
|
53367
|
+
format: "html",
|
|
53368
|
+
content: `After saving client id/secret, open <a href="/addon/${ADDON_ID}${START_PATH}">Connect Google</a> while signed in as admin. Redirect URI uses the Network <b>Public endpoint</b> (today typically <code>https://…/addon/google-services/oauth/callback</code>). If you connected before Gmail send was added, revoke CamStack in Google Account security and reconnect so the refresh token includes <code>gmail.send</code>.`
|
|
53369
|
+
}
|
|
53370
|
+
]
|
|
53371
|
+
},
|
|
53372
|
+
{
|
|
53373
|
+
id: "google-calendar",
|
|
53374
|
+
title: "Google Calendar",
|
|
53375
|
+
description: "Which calendars this hub exposes as calendar-source entries.",
|
|
53376
|
+
columns: 1,
|
|
53377
|
+
fields: [{
|
|
53346
53378
|
type: "text",
|
|
53347
53379
|
key: "calendarFilter",
|
|
53348
53380
|
label: "Calendar id filter (optional)",
|
|
53349
53381
|
description: "Comma-separated Google calendar ids to expose. Empty = all calendars the account can read."
|
|
53350
|
-
}
|
|
53351
|
-
|
|
53352
|
-
|
|
53353
|
-
|
|
53354
|
-
|
|
53355
|
-
|
|
53356
|
-
|
|
53357
|
-
|
|
53358
|
-
|
|
53359
|
-
|
|
53360
|
-
|
|
53361
|
-
|
|
53362
|
-
|
|
53363
|
-
|
|
53364
|
-
|
|
53365
|
-
|
|
53366
|
-
|
|
53367
|
-
|
|
53368
|
-
|
|
53369
|
-
|
|
53370
|
-
|
|
53371
|
-
|
|
53372
|
-
|
|
53373
|
-
|
|
53374
|
-
|
|
53375
|
-
|
|
53376
|
-
|
|
53377
|
-
|
|
53378
|
-
type: "text",
|
|
53379
|
-
key: "fromName",
|
|
53380
|
-
label: "From display name (optional)"
|
|
53381
|
-
}
|
|
53382
|
-
]
|
|
53383
|
-
}] });
|
|
53382
|
+
}]
|
|
53383
|
+
},
|
|
53384
|
+
{
|
|
53385
|
+
id: "gmail-send",
|
|
53386
|
+
title: "Gmail send",
|
|
53387
|
+
description: "Optional email delivery via the Gmail API (`smtp-provider`). Uses the same OAuth account — From must be that account or a verified send-as alias.",
|
|
53388
|
+
columns: 1,
|
|
53389
|
+
fields: [
|
|
53390
|
+
{
|
|
53391
|
+
type: "boolean",
|
|
53392
|
+
key: "gmailSendEnabled",
|
|
53393
|
+
label: "Enable Gmail send",
|
|
53394
|
+
description: "When off, Calendar still works; this addon reports smtp-provider not ready."
|
|
53395
|
+
},
|
|
53396
|
+
{
|
|
53397
|
+
type: "text",
|
|
53398
|
+
key: "fromAddress",
|
|
53399
|
+
label: "From address",
|
|
53400
|
+
description: "Defaults to the connected Google account email when empty."
|
|
53401
|
+
},
|
|
53402
|
+
{
|
|
53403
|
+
type: "text",
|
|
53404
|
+
key: "fromName",
|
|
53405
|
+
label: "From display name (optional)"
|
|
53406
|
+
}
|
|
53407
|
+
]
|
|
53408
|
+
}
|
|
53409
|
+
] });
|
|
53384
53410
|
}
|
|
53385
53411
|
};
|
|
53386
53412
|
function escapeHtml(s) {
|
|
@@ -53320,63 +53320,89 @@ var GoogleServicesAddon = class extends BaseAddon {
|
|
|
53320
53320
|
if (!origin) throw new Error("No hub public address available from local-network — set a Public endpoint on the Network page (OAuth2 redirects use that role, not Internal).");
|
|
53321
53321
|
return `${origin.replace(/\/$/, "")}/addon/${ADDON_ID}${CALLBACK_PATH}`;
|
|
53322
53322
|
}
|
|
53323
|
-
|
|
53324
|
-
|
|
53325
|
-
|
|
53326
|
-
|
|
53327
|
-
|
|
53328
|
-
|
|
53329
|
-
|
|
53330
|
-
|
|
53331
|
-
|
|
53332
|
-
|
|
53333
|
-
|
|
53334
|
-
|
|
53335
|
-
|
|
53336
|
-
|
|
53337
|
-
|
|
53338
|
-
|
|
53339
|
-
|
|
53340
|
-
|
|
53341
|
-
|
|
53323
|
+
/**
|
|
53324
|
+
* Connectivity asks for settings scoped to the page capability, so Calendar
|
|
53325
|
+
* and Email do not each redraw the other's fields (same pattern as
|
|
53326
|
+
* mqtt-broker under `broker`). The addon page (no cap) keeps every section.
|
|
53327
|
+
*/
|
|
53328
|
+
globalSettingsSchema(cap) {
|
|
53329
|
+
const schema = this.fullSettingsSchema();
|
|
53330
|
+
if (cap === "calendar-source") return {
|
|
53331
|
+
...schema,
|
|
53332
|
+
sections: schema.sections.filter((s) => s.id === "google-oauth" || s.id === "google-calendar")
|
|
53333
|
+
};
|
|
53334
|
+
if (cap === "smtp-provider") return {
|
|
53335
|
+
...schema,
|
|
53336
|
+
sections: schema.sections.filter((s) => s.id === "google-oauth" || s.id === "gmail-send")
|
|
53337
|
+
};
|
|
53338
|
+
return schema;
|
|
53339
|
+
}
|
|
53340
|
+
fullSettingsSchema() {
|
|
53341
|
+
return this.schema({ sections: [
|
|
53342
|
+
{
|
|
53343
|
+
id: "google-oauth",
|
|
53344
|
+
title: "Google account",
|
|
53345
|
+
description: "Create an OAuth client (Web application) in Google Cloud Console with the Calendar API and Gmail API enabled. Connect grants both Calendar read and Gmail send on the same account. Register the redirect URI `<public-hub>/addon/google-services/oauth/callback` — hub = Public endpoint from Network (same role as sign-in / OAuth2; Google rejects plain LAN http).",
|
|
53346
|
+
columns: 1,
|
|
53347
|
+
fields: [
|
|
53348
|
+
{
|
|
53349
|
+
type: "text",
|
|
53350
|
+
key: "clientId",
|
|
53351
|
+
label: "Client ID"
|
|
53352
|
+
},
|
|
53353
|
+
{
|
|
53354
|
+
type: "password",
|
|
53355
|
+
key: "clientSecret",
|
|
53356
|
+
label: "Client secret",
|
|
53357
|
+
showToggle: true
|
|
53358
|
+
},
|
|
53359
|
+
{
|
|
53360
|
+
type: "info",
|
|
53361
|
+
key: "_connectInfo",
|
|
53362
|
+
label: "Connect",
|
|
53363
|
+
format: "html",
|
|
53364
|
+
content: `After saving client id/secret, open <a href="/addon/${ADDON_ID}${START_PATH}">Connect Google</a> while signed in as admin. Redirect URI uses the Network <b>Public endpoint</b> (today typically <code>https://…/addon/google-services/oauth/callback</code>). If you connected before Gmail send was added, revoke CamStack in Google Account security and reconnect so the refresh token includes <code>gmail.send</code>.`
|
|
53365
|
+
}
|
|
53366
|
+
]
|
|
53367
|
+
},
|
|
53368
|
+
{
|
|
53369
|
+
id: "google-calendar",
|
|
53370
|
+
title: "Google Calendar",
|
|
53371
|
+
description: "Which calendars this hub exposes as calendar-source entries.",
|
|
53372
|
+
columns: 1,
|
|
53373
|
+
fields: [{
|
|
53342
53374
|
type: "text",
|
|
53343
53375
|
key: "calendarFilter",
|
|
53344
53376
|
label: "Calendar id filter (optional)",
|
|
53345
53377
|
description: "Comma-separated Google calendar ids to expose. Empty = all calendars the account can read."
|
|
53346
|
-
}
|
|
53347
|
-
|
|
53348
|
-
|
|
53349
|
-
|
|
53350
|
-
|
|
53351
|
-
|
|
53352
|
-
|
|
53353
|
-
|
|
53354
|
-
|
|
53355
|
-
|
|
53356
|
-
|
|
53357
|
-
|
|
53358
|
-
|
|
53359
|
-
|
|
53360
|
-
|
|
53361
|
-
|
|
53362
|
-
|
|
53363
|
-
|
|
53364
|
-
|
|
53365
|
-
|
|
53366
|
-
|
|
53367
|
-
|
|
53368
|
-
|
|
53369
|
-
|
|
53370
|
-
|
|
53371
|
-
|
|
53372
|
-
|
|
53373
|
-
|
|
53374
|
-
type: "text",
|
|
53375
|
-
key: "fromName",
|
|
53376
|
-
label: "From display name (optional)"
|
|
53377
|
-
}
|
|
53378
|
-
]
|
|
53379
|
-
}] });
|
|
53378
|
+
}]
|
|
53379
|
+
},
|
|
53380
|
+
{
|
|
53381
|
+
id: "gmail-send",
|
|
53382
|
+
title: "Gmail send",
|
|
53383
|
+
description: "Optional email delivery via the Gmail API (`smtp-provider`). Uses the same OAuth account — From must be that account or a verified send-as alias.",
|
|
53384
|
+
columns: 1,
|
|
53385
|
+
fields: [
|
|
53386
|
+
{
|
|
53387
|
+
type: "boolean",
|
|
53388
|
+
key: "gmailSendEnabled",
|
|
53389
|
+
label: "Enable Gmail send",
|
|
53390
|
+
description: "When off, Calendar still works; this addon reports smtp-provider not ready."
|
|
53391
|
+
},
|
|
53392
|
+
{
|
|
53393
|
+
type: "text",
|
|
53394
|
+
key: "fromAddress",
|
|
53395
|
+
label: "From address",
|
|
53396
|
+
description: "Defaults to the connected Google account email when empty."
|
|
53397
|
+
},
|
|
53398
|
+
{
|
|
53399
|
+
type: "text",
|
|
53400
|
+
key: "fromName",
|
|
53401
|
+
label: "From display name (optional)"
|
|
53402
|
+
}
|
|
53403
|
+
]
|
|
53404
|
+
}
|
|
53405
|
+
] });
|
|
53380
53406
|
}
|
|
53381
53407
|
};
|
|
53382
53408
|
function escapeHtml(s) {
|
package/package.json
CHANGED