@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.
@@ -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
- globalSettingsSchema() {
53328
- return this.schema({ sections: [{
53329
- id: "google-oauth",
53330
- title: "Google OAuth",
53331
- 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).",
53332
- columns: 1,
53333
- fields: [
53334
- {
53335
- type: "text",
53336
- key: "clientId",
53337
- label: "Client ID"
53338
- },
53339
- {
53340
- type: "password",
53341
- key: "clientSecret",
53342
- label: "Client secret",
53343
- showToggle: true
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
- type: "info",
53353
- key: "_connectInfo",
53354
- label: "Connect",
53355
- format: "html",
53356
- 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>.`
53357
- }
53358
- ]
53359
- }, {
53360
- id: "gmail-send",
53361
- title: "Gmail send",
53362
- 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.",
53363
- columns: 1,
53364
- fields: [
53365
- {
53366
- type: "boolean",
53367
- key: "gmailSendEnabled",
53368
- label: "Enable Gmail send",
53369
- description: "When off, Calendar still works; this addon reports smtp-provider not ready."
53370
- },
53371
- {
53372
- type: "text",
53373
- key: "fromAddress",
53374
- label: "From address",
53375
- description: "Defaults to the connected Google account email when empty."
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
- globalSettingsSchema() {
53324
- return this.schema({ sections: [{
53325
- id: "google-oauth",
53326
- title: "Google OAuth",
53327
- 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).",
53328
- columns: 1,
53329
- fields: [
53330
- {
53331
- type: "text",
53332
- key: "clientId",
53333
- label: "Client ID"
53334
- },
53335
- {
53336
- type: "password",
53337
- key: "clientSecret",
53338
- label: "Client secret",
53339
- showToggle: true
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
- type: "info",
53349
- key: "_connectInfo",
53350
- label: "Connect",
53351
- format: "html",
53352
- 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>.`
53353
- }
53354
- ]
53355
- }, {
53356
- id: "gmail-send",
53357
- title: "Gmail send",
53358
- 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.",
53359
- columns: 1,
53360
- fields: [
53361
- {
53362
- type: "boolean",
53363
- key: "gmailSendEnabled",
53364
- label: "Enable Gmail send",
53365
- description: "When off, Calendar still works; this addon reports smtp-provider not ready."
53366
- },
53367
- {
53368
- type: "text",
53369
- key: "fromAddress",
53370
- label: "From address",
53371
- description: "Defaults to the connected Google account email when empty."
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-google-services",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Google Services — Google Calendar (calendar-source) and Gmail send (smtp-provider) via one OAuth2 account.",
5
5
  "keywords": [
6
6
  "camstack",