@camstack/addon-google-services 0.1.5 → 0.1.7
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 +126 -20
- package/dist/google-services.addon.mjs +125 -21
- package/dist/index.js +2 -0
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
|
@@ -18195,14 +18195,14 @@ var LlmProfileSchema = object({
|
|
|
18195
18195
|
/** ConfigUISchema tree passed through untyped on the wire (the
|
|
18196
18196
|
* notification-output `ConfigSchemaPassthrough` precedent at
|
|
18197
18197
|
* notification-output.cap.ts:151); the exported TS type re-tightens it. */
|
|
18198
|
-
var ConfigSchemaPassthrough$
|
|
18198
|
+
var ConfigSchemaPassthrough$3 = unknown();
|
|
18199
18199
|
var LlmProfileKindDescriptorSchema = object({
|
|
18200
18200
|
kind: LlmProfileKindSchema,
|
|
18201
18201
|
label: string(),
|
|
18202
18202
|
icon: string(),
|
|
18203
18203
|
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
18204
18204
|
addonId: string(),
|
|
18205
|
-
configSchema: ConfigSchemaPassthrough$
|
|
18205
|
+
configSchema: ConfigSchemaPassthrough$3
|
|
18206
18206
|
});
|
|
18207
18207
|
var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
|
|
18208
18208
|
var LlmDefaultSchema = object({
|
|
@@ -19323,7 +19323,7 @@ var TargetKindCapsSchema = object({
|
|
|
19323
19323
|
* the union is large and not meant for runtime validation here; the exported
|
|
19324
19324
|
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
19325
19325
|
*/
|
|
19326
|
-
var ConfigSchemaPassthrough$
|
|
19326
|
+
var ConfigSchemaPassthrough$2 = unknown();
|
|
19327
19327
|
var TargetKindSchema = object({
|
|
19328
19328
|
kind: string(),
|
|
19329
19329
|
label: string(),
|
|
@@ -19360,7 +19360,7 @@ var TargetKindSchema = object({
|
|
|
19360
19360
|
* its raster path, which is the safe default for an unknown image.
|
|
19361
19361
|
*/
|
|
19362
19362
|
iconMediaType: string().optional(),
|
|
19363
|
-
configSchema: ConfigSchemaPassthrough$
|
|
19363
|
+
configSchema: ConfigSchemaPassthrough$2,
|
|
19364
19364
|
/**
|
|
19365
19365
|
* The config keys that decide WHERE this kind's secrets are sent (server,
|
|
19366
19366
|
* base URL, instance, chat, recipient). A save that changes any of them
|
|
@@ -22659,6 +22659,61 @@ var OauthIntegrationDescriptorSchema = object({
|
|
|
22659
22659
|
});
|
|
22660
22660
|
method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
|
|
22661
22661
|
/**
|
|
22662
|
+
* `oidc-connections` — CRUD for IdP rows under `auth-oidc` (D828 sibling).
|
|
22663
|
+
*
|
|
22664
|
+
* One hub-only singleton (`auth-oidc`). The Settings UI is a DataTable +
|
|
22665
|
+
* ItemFormDialog; there is no `editable-array` in `globalSettingsSchema`.
|
|
22666
|
+
* Operator-chosen `id` is the URL slug (`/addon/auth-oidc/<id>/…`) and is
|
|
22667
|
+
* immutable after create.
|
|
22668
|
+
*/
|
|
22669
|
+
var ConfigSchemaPassthrough$1 = unknown();
|
|
22670
|
+
var OidcConnectionSchema = object({
|
|
22671
|
+
id: string().min(1),
|
|
22672
|
+
displayName: string(),
|
|
22673
|
+
icon: string(),
|
|
22674
|
+
issuerUrl: string(),
|
|
22675
|
+
clientId: string(),
|
|
22676
|
+
/** Client id + secret present — never the secret value. */
|
|
22677
|
+
configured: boolean(),
|
|
22678
|
+
/**
|
|
22679
|
+
* Values for the connection form schema. `clientSecret` is a keychain
|
|
22680
|
+
* {@link SecretFieldView} or `null` / `''`, never plaintext (D789).
|
|
22681
|
+
*/
|
|
22682
|
+
formValues: record(string(), unknown()).optional()
|
|
22683
|
+
});
|
|
22684
|
+
/**
|
|
22685
|
+
* Patch one connection. Omitted or empty `clientSecret` keeps the stored
|
|
22686
|
+
* secret (D787). `{ $secretClear: true }` clears it. `id` is never renamed.
|
|
22687
|
+
*/
|
|
22688
|
+
var OidcConnectionUpdateInputSchema = object({
|
|
22689
|
+
id: string().min(1),
|
|
22690
|
+
displayName: string().min(1),
|
|
22691
|
+
icon: string().optional(),
|
|
22692
|
+
issuerUrl: string().optional(),
|
|
22693
|
+
clientId: string().optional(),
|
|
22694
|
+
clientSecret: union([string(), object({ $secretClear: literal(true) })]).optional(),
|
|
22695
|
+
redirectUri: string().optional(),
|
|
22696
|
+
scopes: string().optional(),
|
|
22697
|
+
usernameClaim: _enum([
|
|
22698
|
+
"preferred_username",
|
|
22699
|
+
"email",
|
|
22700
|
+
"sub"
|
|
22701
|
+
]).optional()
|
|
22702
|
+
});
|
|
22703
|
+
method(object({}), ConfigSchemaPassthrough$1, { auth: "admin" }), method(object({}), array(OidcConnectionSchema).readonly(), { auth: "admin" }), method(object({
|
|
22704
|
+
id: string().min(1).regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "id must be a lowercase slug"),
|
|
22705
|
+
displayName: string().min(1)
|
|
22706
|
+
}), object({ id: string() }), {
|
|
22707
|
+
kind: "mutation",
|
|
22708
|
+
auth: "admin"
|
|
22709
|
+
}), method(OidcConnectionUpdateInputSchema, object({ ok: literal(true) }), {
|
|
22710
|
+
kind: "mutation",
|
|
22711
|
+
auth: "admin"
|
|
22712
|
+
}), method(object({ id: string().min(1) }), object({ ok: literal(true) }), {
|
|
22713
|
+
kind: "mutation",
|
|
22714
|
+
auth: "admin"
|
|
22715
|
+
});
|
|
22716
|
+
/**
|
|
22662
22717
|
* What started a camera's onboard motion (D672). `camera` is the camera's own
|
|
22663
22718
|
* firmware; `sensor` is a device the operator ATTACHED to it. Absent on the
|
|
22664
22719
|
* wire means the camera: only the camera-sensors bridge ever says `sensor`.
|
|
@@ -44022,6 +44077,36 @@ Object.freeze({
|
|
|
44022
44077
|
addonId: null,
|
|
44023
44078
|
access: "view"
|
|
44024
44079
|
},
|
|
44080
|
+
"oidcConnections.connectionFormSchema": {
|
|
44081
|
+
capName: "oidc-connections",
|
|
44082
|
+
capScope: "system",
|
|
44083
|
+
addonId: null,
|
|
44084
|
+
access: "view"
|
|
44085
|
+
},
|
|
44086
|
+
"oidcConnections.createConnection": {
|
|
44087
|
+
capName: "oidc-connections",
|
|
44088
|
+
capScope: "system",
|
|
44089
|
+
addonId: null,
|
|
44090
|
+
access: "create"
|
|
44091
|
+
},
|
|
44092
|
+
"oidcConnections.deleteConnection": {
|
|
44093
|
+
capName: "oidc-connections",
|
|
44094
|
+
capScope: "system",
|
|
44095
|
+
addonId: null,
|
|
44096
|
+
access: "delete"
|
|
44097
|
+
},
|
|
44098
|
+
"oidcConnections.listConnections": {
|
|
44099
|
+
capName: "oidc-connections",
|
|
44100
|
+
capScope: "system",
|
|
44101
|
+
addonId: null,
|
|
44102
|
+
access: "view"
|
|
44103
|
+
},
|
|
44104
|
+
"oidcConnections.updateConnection": {
|
|
44105
|
+
capName: "oidc-connections",
|
|
44106
|
+
capScope: "system",
|
|
44107
|
+
addonId: null,
|
|
44108
|
+
access: "create"
|
|
44109
|
+
},
|
|
44025
44110
|
"osd.getStatus": {
|
|
44026
44111
|
capName: "osd",
|
|
44027
44112
|
capScope: "device",
|
|
@@ -53132,40 +53217,53 @@ function needsRefresh(state, nowMs = Date.now()) {
|
|
|
53132
53217
|
* Operator-facing setup copy for Connectivity → Calendars / Email.
|
|
53133
53218
|
* Keep Connect as a same-origin relative link so the admin session cookie
|
|
53134
53219
|
* rides along (an absolute Public URL from a LAN admin tab drops the cookie).
|
|
53220
|
+
* Root-relative hrefs must survive `sanitizeInfoHtml` in ui-library.
|
|
53135
53221
|
*/
|
|
53222
|
+
/** Enable APIs library in Google Cloud Console. */
|
|
53223
|
+
var GOOGLE_CONSOLE_APIS_URL = "https://console.cloud.google.com/apis/library";
|
|
53224
|
+
/** Create / manage OAuth Web clients. */
|
|
53225
|
+
var GOOGLE_CONSOLE_CREDENTIALS_URL = "https://console.cloud.google.com/apis/credentials";
|
|
53136
53226
|
function redirectUriDisplay(publicOrigin) {
|
|
53137
53227
|
if (publicOrigin === null || publicOrigin.length === 0) return `<public-hub>${OAUTH_CALLBACK_SUFFIX}`;
|
|
53138
53228
|
return `${publicOrigin.replace(/\/$/, "")}${OAUTH_CALLBACK_SUFFIX}`;
|
|
53139
53229
|
}
|
|
53230
|
+
function consoleLinksHtml() {
|
|
53231
|
+
return [
|
|
53232
|
+
`<a href="${GOOGLE_CONSOLE_APIS_URL}">API library</a>`,
|
|
53233
|
+
` · `,
|
|
53234
|
+
`<a href="${GOOGLE_CONSOLE_CREDENTIALS_URL}">Credentials</a>`
|
|
53235
|
+
].join("");
|
|
53236
|
+
}
|
|
53140
53237
|
function introHtml(cap, publicOrigin) {
|
|
53141
53238
|
const redirect = escapeHtml$1(redirectUriDisplay(publicOrigin));
|
|
53239
|
+
const console = consoleLinksHtml();
|
|
53142
53240
|
if (cap === "smtp-provider") return [
|
|
53143
53241
|
"<ol>",
|
|
53144
|
-
|
|
53145
|
-
"<li>
|
|
53146
|
-
`<li>Add this authorized redirect URI (Network → <
|
|
53147
|
-
"<li>Paste Client ID and Client secret below, then <
|
|
53242
|
+
`<li>Open Google Cloud Console (${console}) and enable the <strong>Gmail API</strong> (and Calendar API if you also use Calendars).</li>`,
|
|
53243
|
+
"<li>Under Credentials, create an OAuth client of type <strong>Web application</strong>.</li>",
|
|
53244
|
+
`<li>Add this authorized redirect URI (Network → <strong>Public endpoint</strong>, not Internal): <code>${redirect}</code></li>`,
|
|
53245
|
+
"<li>Paste Client ID and Client secret below, then <strong>Save</strong>.</li>",
|
|
53148
53246
|
`<li>Open <a href="${OAUTH_START_PATH}">Connect Google</a> while signed in as admin (same browser tab as this hub).</li>`,
|
|
53149
|
-
"<li>Set From address (connected account or a verified send-as). Turn this integration off with the page <
|
|
53247
|
+
"<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>",
|
|
53150
53248
|
"</ol>"
|
|
53151
53249
|
].join("");
|
|
53152
53250
|
if (cap === "calendar-source") return [
|
|
53153
53251
|
"<ol>",
|
|
53154
|
-
|
|
53155
|
-
"<li>
|
|
53156
|
-
`<li>Add this authorized redirect URI (Network → <
|
|
53157
|
-
"<li>Paste Client ID and Client secret below, then <
|
|
53252
|
+
`<li>Open Google Cloud Console (${console}) and enable the <strong>Google Calendar API</strong> (and Gmail API if you also use Email).</li>`,
|
|
53253
|
+
"<li>Under Credentials, create an OAuth client of type <strong>Web application</strong>.</li>",
|
|
53254
|
+
`<li>Add this authorized redirect URI (Network → <strong>Public endpoint</strong>, not Internal): <code>${redirect}</code></li>`,
|
|
53255
|
+
"<li>Paste Client ID and Client secret below, then <strong>Save</strong>.</li>",
|
|
53158
53256
|
`<li>Open <a href="${OAUTH_START_PATH}">Connect Google</a> while signed in as admin (same browser tab as this hub).</li>`,
|
|
53159
53257
|
"<li>Optionally restrict which calendars are exposed with the filter below.</li>",
|
|
53160
53258
|
"</ol>"
|
|
53161
53259
|
].join("");
|
|
53162
53260
|
return [
|
|
53163
53261
|
"<ol>",
|
|
53164
|
-
|
|
53165
|
-
"<li>Create a <
|
|
53262
|
+
`<li>Open Google Cloud Console (${console}) and enable <strong>Google Calendar API</strong> and <strong>Gmail API</strong>.</li>`,
|
|
53263
|
+
"<li>Create a <strong>Web application</strong> OAuth client under Credentials.</li>",
|
|
53166
53264
|
`<li>Register redirect URI: <code>${redirect}</code> (Network → Public endpoint).</li>`,
|
|
53167
|
-
|
|
53168
|
-
"<li>Calendars and Email share one Google account; use each page’s <
|
|
53265
|
+
`<li>Paste Client ID / secret, Save, then <a href="${OAUTH_START_PATH}">Connect Google</a>.</li>`,
|
|
53266
|
+
"<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>",
|
|
53169
53267
|
"</ol>"
|
|
53170
53268
|
].join("");
|
|
53171
53269
|
}
|
|
@@ -53175,14 +53273,20 @@ function connectHtml(cap, publicOrigin) {
|
|
|
53175
53273
|
`After Save, open <a href="${OAUTH_START_PATH}">Connect Google</a> in this hub (admin session required). `,
|
|
53176
53274
|
"Connect requests <code>gmail.send</code> (and Calendar read for the Calendars page). ",
|
|
53177
53275
|
`Google must list exactly: <code>${redirect}</code>. `,
|
|
53178
|
-
"If an older Connect predates Gmail send, revoke CamStack in Google Account → Security and Connect again."
|
|
53276
|
+
"If an older Connect predates Gmail send, revoke CamStack in Google Account → Security and Connect again. ",
|
|
53277
|
+
`Console: ${consoleLinksHtml()}.`
|
|
53179
53278
|
].join("");
|
|
53180
53279
|
if (cap === "calendar-source") return [
|
|
53181
53280
|
`After Save, open <a href="${OAUTH_START_PATH}">Connect Google</a> in this hub (admin session required). `,
|
|
53182
53281
|
"Connect requests <code>calendar.readonly</code> (and Gmail send for the Email page). ",
|
|
53183
|
-
`Google must list exactly: <code>${redirect}</code
|
|
53282
|
+
`Google must list exactly: <code>${redirect}</code>. `,
|
|
53283
|
+
`Console: ${consoleLinksHtml()}.`
|
|
53284
|
+
].join("");
|
|
53285
|
+
return [
|
|
53286
|
+
`After Save, open <a href="${OAUTH_START_PATH}">Connect Google</a>. `,
|
|
53287
|
+
`Redirect URI registered in Google Cloud must be <code>${redirect}</code>. `,
|
|
53288
|
+
`Console: ${consoleLinksHtml()}.`
|
|
53184
53289
|
].join("");
|
|
53185
|
-
return [`After Save, open <a href="${OAUTH_START_PATH}">Connect Google</a>. `, `Redirect URI registered in Google Cloud must be <code>${redirect}</code>.`].join("");
|
|
53186
53290
|
}
|
|
53187
53291
|
function escapeHtml$1(s) {
|
|
53188
53292
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -53475,6 +53579,8 @@ function escapeHtml(s) {
|
|
|
53475
53579
|
}
|
|
53476
53580
|
//#endregion
|
|
53477
53581
|
exports.DEFAULT_GOOGLE_CONFIG = DEFAULT_GOOGLE_CONFIG;
|
|
53582
|
+
exports.GOOGLE_CONSOLE_APIS_URL = GOOGLE_CONSOLE_APIS_URL;
|
|
53583
|
+
exports.GOOGLE_CONSOLE_CREDENTIALS_URL = GOOGLE_CONSOLE_CREDENTIALS_URL;
|
|
53478
53584
|
exports.GOOGLE_GMAIL_SEND_SCOPE = GOOGLE_GMAIL_SEND_SCOPE;
|
|
53479
53585
|
exports.GOOGLE_OAUTH_SCOPES = GOOGLE_OAUTH_SCOPES;
|
|
53480
53586
|
exports.GoogleServicesAddon = GoogleServicesAddon;
|
|
@@ -18191,14 +18191,14 @@ var LlmProfileSchema = object({
|
|
|
18191
18191
|
/** ConfigUISchema tree passed through untyped on the wire (the
|
|
18192
18192
|
* notification-output `ConfigSchemaPassthrough` precedent at
|
|
18193
18193
|
* notification-output.cap.ts:151); the exported TS type re-tightens it. */
|
|
18194
|
-
var ConfigSchemaPassthrough$
|
|
18194
|
+
var ConfigSchemaPassthrough$3 = unknown();
|
|
18195
18195
|
var LlmProfileKindDescriptorSchema = object({
|
|
18196
18196
|
kind: LlmProfileKindSchema,
|
|
18197
18197
|
label: string(),
|
|
18198
18198
|
icon: string(),
|
|
18199
18199
|
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
18200
18200
|
addonId: string(),
|
|
18201
|
-
configSchema: ConfigSchemaPassthrough$
|
|
18201
|
+
configSchema: ConfigSchemaPassthrough$3
|
|
18202
18202
|
});
|
|
18203
18203
|
var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
|
|
18204
18204
|
var LlmDefaultSchema = object({
|
|
@@ -19319,7 +19319,7 @@ var TargetKindCapsSchema = object({
|
|
|
19319
19319
|
* the union is large and not meant for runtime validation here; the exported
|
|
19320
19320
|
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
19321
19321
|
*/
|
|
19322
|
-
var ConfigSchemaPassthrough$
|
|
19322
|
+
var ConfigSchemaPassthrough$2 = unknown();
|
|
19323
19323
|
var TargetKindSchema = object({
|
|
19324
19324
|
kind: string(),
|
|
19325
19325
|
label: string(),
|
|
@@ -19356,7 +19356,7 @@ var TargetKindSchema = object({
|
|
|
19356
19356
|
* its raster path, which is the safe default for an unknown image.
|
|
19357
19357
|
*/
|
|
19358
19358
|
iconMediaType: string().optional(),
|
|
19359
|
-
configSchema: ConfigSchemaPassthrough$
|
|
19359
|
+
configSchema: ConfigSchemaPassthrough$2,
|
|
19360
19360
|
/**
|
|
19361
19361
|
* The config keys that decide WHERE this kind's secrets are sent (server,
|
|
19362
19362
|
* base URL, instance, chat, recipient). A save that changes any of them
|
|
@@ -22655,6 +22655,61 @@ var OauthIntegrationDescriptorSchema = object({
|
|
|
22655
22655
|
});
|
|
22656
22656
|
method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
|
|
22657
22657
|
/**
|
|
22658
|
+
* `oidc-connections` — CRUD for IdP rows under `auth-oidc` (D828 sibling).
|
|
22659
|
+
*
|
|
22660
|
+
* One hub-only singleton (`auth-oidc`). The Settings UI is a DataTable +
|
|
22661
|
+
* ItemFormDialog; there is no `editable-array` in `globalSettingsSchema`.
|
|
22662
|
+
* Operator-chosen `id` is the URL slug (`/addon/auth-oidc/<id>/…`) and is
|
|
22663
|
+
* immutable after create.
|
|
22664
|
+
*/
|
|
22665
|
+
var ConfigSchemaPassthrough$1 = unknown();
|
|
22666
|
+
var OidcConnectionSchema = object({
|
|
22667
|
+
id: string().min(1),
|
|
22668
|
+
displayName: string(),
|
|
22669
|
+
icon: string(),
|
|
22670
|
+
issuerUrl: string(),
|
|
22671
|
+
clientId: string(),
|
|
22672
|
+
/** Client id + secret present — never the secret value. */
|
|
22673
|
+
configured: boolean(),
|
|
22674
|
+
/**
|
|
22675
|
+
* Values for the connection form schema. `clientSecret` is a keychain
|
|
22676
|
+
* {@link SecretFieldView} or `null` / `''`, never plaintext (D789).
|
|
22677
|
+
*/
|
|
22678
|
+
formValues: record(string(), unknown()).optional()
|
|
22679
|
+
});
|
|
22680
|
+
/**
|
|
22681
|
+
* Patch one connection. Omitted or empty `clientSecret` keeps the stored
|
|
22682
|
+
* secret (D787). `{ $secretClear: true }` clears it. `id` is never renamed.
|
|
22683
|
+
*/
|
|
22684
|
+
var OidcConnectionUpdateInputSchema = object({
|
|
22685
|
+
id: string().min(1),
|
|
22686
|
+
displayName: string().min(1),
|
|
22687
|
+
icon: string().optional(),
|
|
22688
|
+
issuerUrl: string().optional(),
|
|
22689
|
+
clientId: string().optional(),
|
|
22690
|
+
clientSecret: union([string(), object({ $secretClear: literal(true) })]).optional(),
|
|
22691
|
+
redirectUri: string().optional(),
|
|
22692
|
+
scopes: string().optional(),
|
|
22693
|
+
usernameClaim: _enum([
|
|
22694
|
+
"preferred_username",
|
|
22695
|
+
"email",
|
|
22696
|
+
"sub"
|
|
22697
|
+
]).optional()
|
|
22698
|
+
});
|
|
22699
|
+
method(object({}), ConfigSchemaPassthrough$1, { auth: "admin" }), method(object({}), array(OidcConnectionSchema).readonly(), { auth: "admin" }), method(object({
|
|
22700
|
+
id: string().min(1).regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "id must be a lowercase slug"),
|
|
22701
|
+
displayName: string().min(1)
|
|
22702
|
+
}), object({ id: string() }), {
|
|
22703
|
+
kind: "mutation",
|
|
22704
|
+
auth: "admin"
|
|
22705
|
+
}), method(OidcConnectionUpdateInputSchema, object({ ok: literal(true) }), {
|
|
22706
|
+
kind: "mutation",
|
|
22707
|
+
auth: "admin"
|
|
22708
|
+
}), method(object({ id: string().min(1) }), object({ ok: literal(true) }), {
|
|
22709
|
+
kind: "mutation",
|
|
22710
|
+
auth: "admin"
|
|
22711
|
+
});
|
|
22712
|
+
/**
|
|
22658
22713
|
* What started a camera's onboard motion (D672). `camera` is the camera's own
|
|
22659
22714
|
* firmware; `sensor` is a device the operator ATTACHED to it. Absent on the
|
|
22660
22715
|
* wire means the camera: only the camera-sensors bridge ever says `sensor`.
|
|
@@ -44018,6 +44073,36 @@ Object.freeze({
|
|
|
44018
44073
|
addonId: null,
|
|
44019
44074
|
access: "view"
|
|
44020
44075
|
},
|
|
44076
|
+
"oidcConnections.connectionFormSchema": {
|
|
44077
|
+
capName: "oidc-connections",
|
|
44078
|
+
capScope: "system",
|
|
44079
|
+
addonId: null,
|
|
44080
|
+
access: "view"
|
|
44081
|
+
},
|
|
44082
|
+
"oidcConnections.createConnection": {
|
|
44083
|
+
capName: "oidc-connections",
|
|
44084
|
+
capScope: "system",
|
|
44085
|
+
addonId: null,
|
|
44086
|
+
access: "create"
|
|
44087
|
+
},
|
|
44088
|
+
"oidcConnections.deleteConnection": {
|
|
44089
|
+
capName: "oidc-connections",
|
|
44090
|
+
capScope: "system",
|
|
44091
|
+
addonId: null,
|
|
44092
|
+
access: "delete"
|
|
44093
|
+
},
|
|
44094
|
+
"oidcConnections.listConnections": {
|
|
44095
|
+
capName: "oidc-connections",
|
|
44096
|
+
capScope: "system",
|
|
44097
|
+
addonId: null,
|
|
44098
|
+
access: "view"
|
|
44099
|
+
},
|
|
44100
|
+
"oidcConnections.updateConnection": {
|
|
44101
|
+
capName: "oidc-connections",
|
|
44102
|
+
capScope: "system",
|
|
44103
|
+
addonId: null,
|
|
44104
|
+
access: "create"
|
|
44105
|
+
},
|
|
44021
44106
|
"osd.getStatus": {
|
|
44022
44107
|
capName: "osd",
|
|
44023
44108
|
capScope: "device",
|
|
@@ -53128,40 +53213,53 @@ function needsRefresh(state, nowMs = Date.now()) {
|
|
|
53128
53213
|
* Operator-facing setup copy for Connectivity → Calendars / Email.
|
|
53129
53214
|
* Keep Connect as a same-origin relative link so the admin session cookie
|
|
53130
53215
|
* rides along (an absolute Public URL from a LAN admin tab drops the cookie).
|
|
53216
|
+
* Root-relative hrefs must survive `sanitizeInfoHtml` in ui-library.
|
|
53131
53217
|
*/
|
|
53218
|
+
/** Enable APIs library in Google Cloud Console. */
|
|
53219
|
+
var GOOGLE_CONSOLE_APIS_URL = "https://console.cloud.google.com/apis/library";
|
|
53220
|
+
/** Create / manage OAuth Web clients. */
|
|
53221
|
+
var GOOGLE_CONSOLE_CREDENTIALS_URL = "https://console.cloud.google.com/apis/credentials";
|
|
53132
53222
|
function redirectUriDisplay(publicOrigin) {
|
|
53133
53223
|
if (publicOrigin === null || publicOrigin.length === 0) return `<public-hub>${OAUTH_CALLBACK_SUFFIX}`;
|
|
53134
53224
|
return `${publicOrigin.replace(/\/$/, "")}${OAUTH_CALLBACK_SUFFIX}`;
|
|
53135
53225
|
}
|
|
53226
|
+
function consoleLinksHtml() {
|
|
53227
|
+
return [
|
|
53228
|
+
`<a href="${GOOGLE_CONSOLE_APIS_URL}">API library</a>`,
|
|
53229
|
+
` · `,
|
|
53230
|
+
`<a href="${GOOGLE_CONSOLE_CREDENTIALS_URL}">Credentials</a>`
|
|
53231
|
+
].join("");
|
|
53232
|
+
}
|
|
53136
53233
|
function introHtml(cap, publicOrigin) {
|
|
53137
53234
|
const redirect = escapeHtml$1(redirectUriDisplay(publicOrigin));
|
|
53235
|
+
const console = consoleLinksHtml();
|
|
53138
53236
|
if (cap === "smtp-provider") return [
|
|
53139
53237
|
"<ol>",
|
|
53140
|
-
|
|
53141
|
-
"<li>
|
|
53142
|
-
`<li>Add this authorized redirect URI (Network → <
|
|
53143
|
-
"<li>Paste Client ID and Client secret below, then <
|
|
53238
|
+
`<li>Open Google Cloud Console (${console}) and enable the <strong>Gmail API</strong> (and Calendar API if you also use Calendars).</li>`,
|
|
53239
|
+
"<li>Under Credentials, create an OAuth client of type <strong>Web application</strong>.</li>",
|
|
53240
|
+
`<li>Add this authorized redirect URI (Network → <strong>Public endpoint</strong>, not Internal): <code>${redirect}</code></li>`,
|
|
53241
|
+
"<li>Paste Client ID and Client secret below, then <strong>Save</strong>.</li>",
|
|
53144
53242
|
`<li>Open <a href="${OAUTH_START_PATH}">Connect Google</a> while signed in as admin (same browser tab as this hub).</li>`,
|
|
53145
|
-
"<li>Set From address (connected account or a verified send-as). Turn this integration off with the page <
|
|
53243
|
+
"<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>",
|
|
53146
53244
|
"</ol>"
|
|
53147
53245
|
].join("");
|
|
53148
53246
|
if (cap === "calendar-source") return [
|
|
53149
53247
|
"<ol>",
|
|
53150
|
-
|
|
53151
|
-
"<li>
|
|
53152
|
-
`<li>Add this authorized redirect URI (Network → <
|
|
53153
|
-
"<li>Paste Client ID and Client secret below, then <
|
|
53248
|
+
`<li>Open Google Cloud Console (${console}) and enable the <strong>Google Calendar API</strong> (and Gmail API if you also use Email).</li>`,
|
|
53249
|
+
"<li>Under Credentials, create an OAuth client of type <strong>Web application</strong>.</li>",
|
|
53250
|
+
`<li>Add this authorized redirect URI (Network → <strong>Public endpoint</strong>, not Internal): <code>${redirect}</code></li>`,
|
|
53251
|
+
"<li>Paste Client ID and Client secret below, then <strong>Save</strong>.</li>",
|
|
53154
53252
|
`<li>Open <a href="${OAUTH_START_PATH}">Connect Google</a> while signed in as admin (same browser tab as this hub).</li>`,
|
|
53155
53253
|
"<li>Optionally restrict which calendars are exposed with the filter below.</li>",
|
|
53156
53254
|
"</ol>"
|
|
53157
53255
|
].join("");
|
|
53158
53256
|
return [
|
|
53159
53257
|
"<ol>",
|
|
53160
|
-
|
|
53161
|
-
"<li>Create a <
|
|
53258
|
+
`<li>Open Google Cloud Console (${console}) and enable <strong>Google Calendar API</strong> and <strong>Gmail API</strong>.</li>`,
|
|
53259
|
+
"<li>Create a <strong>Web application</strong> OAuth client under Credentials.</li>",
|
|
53162
53260
|
`<li>Register redirect URI: <code>${redirect}</code> (Network → Public endpoint).</li>`,
|
|
53163
|
-
|
|
53164
|
-
"<li>Calendars and Email share one Google account; use each page’s <
|
|
53261
|
+
`<li>Paste Client ID / secret, Save, then <a href="${OAUTH_START_PATH}">Connect Google</a>.</li>`,
|
|
53262
|
+
"<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>",
|
|
53165
53263
|
"</ol>"
|
|
53166
53264
|
].join("");
|
|
53167
53265
|
}
|
|
@@ -53171,14 +53269,20 @@ function connectHtml(cap, publicOrigin) {
|
|
|
53171
53269
|
`After Save, open <a href="${OAUTH_START_PATH}">Connect Google</a> in this hub (admin session required). `,
|
|
53172
53270
|
"Connect requests <code>gmail.send</code> (and Calendar read for the Calendars page). ",
|
|
53173
53271
|
`Google must list exactly: <code>${redirect}</code>. `,
|
|
53174
|
-
"If an older Connect predates Gmail send, revoke CamStack in Google Account → Security and Connect again."
|
|
53272
|
+
"If an older Connect predates Gmail send, revoke CamStack in Google Account → Security and Connect again. ",
|
|
53273
|
+
`Console: ${consoleLinksHtml()}.`
|
|
53175
53274
|
].join("");
|
|
53176
53275
|
if (cap === "calendar-source") return [
|
|
53177
53276
|
`After Save, open <a href="${OAUTH_START_PATH}">Connect Google</a> in this hub (admin session required). `,
|
|
53178
53277
|
"Connect requests <code>calendar.readonly</code> (and Gmail send for the Email page). ",
|
|
53179
|
-
`Google must list exactly: <code>${redirect}</code
|
|
53278
|
+
`Google must list exactly: <code>${redirect}</code>. `,
|
|
53279
|
+
`Console: ${consoleLinksHtml()}.`
|
|
53280
|
+
].join("");
|
|
53281
|
+
return [
|
|
53282
|
+
`After Save, open <a href="${OAUTH_START_PATH}">Connect Google</a>. `,
|
|
53283
|
+
`Redirect URI registered in Google Cloud must be <code>${redirect}</code>. `,
|
|
53284
|
+
`Console: ${consoleLinksHtml()}.`
|
|
53180
53285
|
].join("");
|
|
53181
|
-
return [`After Save, open <a href="${OAUTH_START_PATH}">Connect Google</a>. `, `Redirect URI registered in Google Cloud must be <code>${redirect}</code>.`].join("");
|
|
53182
53286
|
}
|
|
53183
53287
|
function escapeHtml$1(s) {
|
|
53184
53288
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -53470,4 +53574,4 @@ function escapeHtml(s) {
|
|
|
53470
53574
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
53471
53575
|
}
|
|
53472
53576
|
//#endregion
|
|
53473
|
-
export { GoogleServicesAddon, GoogleServicesAddon as default,
|
|
53577
|
+
export { GoogleServicesAddon, GoogleServicesAddon as default, GOOGLE_GMAIL_SEND_SCOPE as _, redirectUriDisplay as a, OAUTH_START_PATH as b, exchangeCode as c, buildRawMime as d, createGmailSmtpProvider as f, DEFAULT_GOOGLE_CONFIG as g, mapGoogleEvent as h, introHtml as i, needsRefresh as l, createGoogleCalendarSource as m, GOOGLE_CONSOLE_CREDENTIALS_URL as n, applyTokenResponse as o, createGoogleCalendarApi as p, connectHtml as r, buildAuthorizeUrl as s, GOOGLE_CONSOLE_APIS_URL as t, refreshAccessToken as u, GOOGLE_OAUTH_SCOPES as v, GoogleServicesConfigSchema as y };
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,8 @@ Object.defineProperties(exports, {
|
|
|
4
4
|
});
|
|
5
5
|
const require_google_services_addon = require("./google-services.addon.js");
|
|
6
6
|
exports.DEFAULT_GOOGLE_CONFIG = require_google_services_addon.DEFAULT_GOOGLE_CONFIG;
|
|
7
|
+
exports.GOOGLE_CONSOLE_APIS_URL = require_google_services_addon.GOOGLE_CONSOLE_APIS_URL;
|
|
8
|
+
exports.GOOGLE_CONSOLE_CREDENTIALS_URL = require_google_services_addon.GOOGLE_CONSOLE_CREDENTIALS_URL;
|
|
7
9
|
exports.GOOGLE_GMAIL_SEND_SCOPE = require_google_services_addon.GOOGLE_GMAIL_SEND_SCOPE;
|
|
8
10
|
exports.GOOGLE_OAUTH_SCOPES = require_google_services_addon.GOOGLE_OAUTH_SCOPES;
|
|
9
11
|
exports.GoogleServicesAddon = require_google_services_addon.GoogleServicesAddon;
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GoogleServicesAddon, _ as
|
|
2
|
-
export { DEFAULT_GOOGLE_CONFIG, GOOGLE_GMAIL_SEND_SCOPE, GOOGLE_OAUTH_SCOPES, GoogleServicesAddon, GoogleServicesAddon as default, GoogleServicesConfigSchema, OAUTH_START_PATH, applyTokenResponse, buildAuthorizeUrl, buildRawMime, connectHtml, createGmailSmtpProvider, createGoogleCalendarApi, createGoogleCalendarSource, exchangeCode, introHtml, mapGoogleEvent, needsRefresh, redirectUriDisplay, refreshAccessToken };
|
|
1
|
+
import { GoogleServicesAddon, _ as GOOGLE_GMAIL_SEND_SCOPE, a as redirectUriDisplay, b as OAUTH_START_PATH, c as exchangeCode, d as buildRawMime, f as createGmailSmtpProvider, g as DEFAULT_GOOGLE_CONFIG, h as mapGoogleEvent, i as introHtml, l as needsRefresh, m as createGoogleCalendarSource, n as GOOGLE_CONSOLE_CREDENTIALS_URL, o as applyTokenResponse, p as createGoogleCalendarApi, r as connectHtml, s as buildAuthorizeUrl, t as GOOGLE_CONSOLE_APIS_URL, u as refreshAccessToken, v as GOOGLE_OAUTH_SCOPES, y as GoogleServicesConfigSchema } from "./google-services.addon.mjs";
|
|
2
|
+
export { DEFAULT_GOOGLE_CONFIG, GOOGLE_CONSOLE_APIS_URL, GOOGLE_CONSOLE_CREDENTIALS_URL, GOOGLE_GMAIL_SEND_SCOPE, GOOGLE_OAUTH_SCOPES, GoogleServicesAddon, GoogleServicesAddon as default, GoogleServicesConfigSchema, OAUTH_START_PATH, applyTokenResponse, buildAuthorizeUrl, buildRawMime, connectHtml, createGmailSmtpProvider, createGoogleCalendarApi, createGoogleCalendarSource, exchangeCode, introHtml, mapGoogleEvent, needsRefresh, redirectUriDisplay, refreshAccessToken };
|
package/package.json
CHANGED