@broberg/legal 0.8.0 → 0.9.0

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/index.d.cts CHANGED
@@ -80,6 +80,12 @@ interface ProductFacts {
80
80
  healthData: boolean;
81
81
  /** F110.17 — only a platform with third-party modules (an App Store) sets this; the "modules" document needs it. */
82
82
  modules?: ModuleTermsFacts;
83
+ /**
84
+ * F110.18 — the product reads Google user data through Google APIs (e.g. a gmail scope).
85
+ * Google's brand verification requires its Limited Use statement VERBATIM in the privacy
86
+ * policy; true renders it. Omitted/false: the document is unchanged (same contentHash).
87
+ */
88
+ googleApiLimitedUse?: boolean;
83
89
  }
84
90
  /** The numbers and channels in the module-owner terms. The PRODUCT decides them; the text never contains them. */
85
91
  interface ModuleTermsFacts {
@@ -102,7 +108,7 @@ interface ModuleTermsFacts {
102
108
  complaintsResponse: string;
103
109
  exportDays: number;
104
110
  }
105
- type FactKey = "hosting" | "dataCategories" | "subprocessors" | "conversationAnalysis" | "moduleTerms";
111
+ type FactKey = "hosting" | "dataCategories" | "subprocessors" | "conversationAnalysis" | "moduleTerms" | "googleApiLimitedUse";
106
112
  /** The merge fields Contract Manager fills (contract-manager #5608, 31 Oct 2026). */
107
113
  declare const PLACEHOLDERS: readonly ["customer.name", "customer.altName", "customer.cvr", "customer.companyForm", "customer.address", "customer.contact.name", "customer.contact.email", "customer.contact.phone", "provider.name", "provider.cvr", "provider.address", "provider.contact.name", "provider.contact.email", "contract.id", "contract.title", "contract.version", "contract.date", "contract.startDate"];
108
114
  type Placeholder = (typeof PLACEHOLDERS)[number];
@@ -161,6 +167,7 @@ declare function createLibrary(sources: DocumentSource[], products: ProductFacts
161
167
  doc: DocId;
162
168
  locale: Locale;
163
169
  product: string;
170
+ stale?: boolean;
164
171
  }) => LegalDocument;
165
172
  products: () => string[];
166
173
  sources: () => DocumentSource[];
@@ -316,6 +323,6 @@ declare function getDocument(opts: {
316
323
  facts: ProductFacts;
317
324
  }): LegalDocument;
318
325
  /** A finished document from a template you fetched from the API + your own facts. */
319
- declare function resolveTemplate(template: DocumentSource, facts: ProductFacts): LegalDocument;
326
+ declare function resolveTemplate(template: DocumentSource | LegalTemplate, facts: ProductFacts): LegalDocument;
320
327
 
321
328
  export { type AcceptanceRecord, type AcceptedDoc, BID_URL, type BidCallOptions, BidConsentError, type Block, type ConsentRecord, DEFAULT_REFRESH_MS, DOC_IDS, type DocId, type DocumentSource, EXAMPLE_FACTS, type FactKey, LEGAL_API_URL, type LegalCacheOptions, type LegalDocument, type LegalTemplate, type Locale, MASTER_LOCALE, type ModuleTermsFacts, PLACEHOLDERS, type Placeholder, type ProductFacts, type ResolvedBlock, type ResolvedSection, SOURCES, type Section, canonicalJson, createLegalCache, createLibrary, getAcceptance, getConsent, getDocument, getTemplate, listDocuments, needsReaccept, parityProblems, placeholdersIn, recordAcceptance, recordConsent, renderHtml, resolveTemplate, sha256Hex, sourceHash, templateHash, toBidHash, verifyTemplate };
package/dist/index.d.ts CHANGED
@@ -80,6 +80,12 @@ interface ProductFacts {
80
80
  healthData: boolean;
81
81
  /** F110.17 — only a platform with third-party modules (an App Store) sets this; the "modules" document needs it. */
82
82
  modules?: ModuleTermsFacts;
83
+ /**
84
+ * F110.18 — the product reads Google user data through Google APIs (e.g. a gmail scope).
85
+ * Google's brand verification requires its Limited Use statement VERBATIM in the privacy
86
+ * policy; true renders it. Omitted/false: the document is unchanged (same contentHash).
87
+ */
88
+ googleApiLimitedUse?: boolean;
83
89
  }
84
90
  /** The numbers and channels in the module-owner terms. The PRODUCT decides them; the text never contains them. */
85
91
  interface ModuleTermsFacts {
@@ -102,7 +108,7 @@ interface ModuleTermsFacts {
102
108
  complaintsResponse: string;
103
109
  exportDays: number;
104
110
  }
105
- type FactKey = "hosting" | "dataCategories" | "subprocessors" | "conversationAnalysis" | "moduleTerms";
111
+ type FactKey = "hosting" | "dataCategories" | "subprocessors" | "conversationAnalysis" | "moduleTerms" | "googleApiLimitedUse";
106
112
  /** The merge fields Contract Manager fills (contract-manager #5608, 31 Oct 2026). */
107
113
  declare const PLACEHOLDERS: readonly ["customer.name", "customer.altName", "customer.cvr", "customer.companyForm", "customer.address", "customer.contact.name", "customer.contact.email", "customer.contact.phone", "provider.name", "provider.cvr", "provider.address", "provider.contact.name", "provider.contact.email", "contract.id", "contract.title", "contract.version", "contract.date", "contract.startDate"];
108
114
  type Placeholder = (typeof PLACEHOLDERS)[number];
@@ -161,6 +167,7 @@ declare function createLibrary(sources: DocumentSource[], products: ProductFacts
161
167
  doc: DocId;
162
168
  locale: Locale;
163
169
  product: string;
170
+ stale?: boolean;
164
171
  }) => LegalDocument;
165
172
  products: () => string[];
166
173
  sources: () => DocumentSource[];
@@ -316,6 +323,6 @@ declare function getDocument(opts: {
316
323
  facts: ProductFacts;
317
324
  }): LegalDocument;
318
325
  /** A finished document from a template you fetched from the API + your own facts. */
319
- declare function resolveTemplate(template: DocumentSource, facts: ProductFacts): LegalDocument;
326
+ declare function resolveTemplate(template: DocumentSource | LegalTemplate, facts: ProductFacts): LegalDocument;
320
327
 
321
328
  export { type AcceptanceRecord, type AcceptedDoc, BID_URL, type BidCallOptions, BidConsentError, type Block, type ConsentRecord, DEFAULT_REFRESH_MS, DOC_IDS, type DocId, type DocumentSource, EXAMPLE_FACTS, type FactKey, LEGAL_API_URL, type LegalCacheOptions, type LegalDocument, type LegalTemplate, type Locale, MASTER_LOCALE, type ModuleTermsFacts, PLACEHOLDERS, type Placeholder, type ProductFacts, type ResolvedBlock, type ResolvedSection, SOURCES, type Section, canonicalJson, createLegalCache, createLibrary, getAcceptance, getConsent, getDocument, getTemplate, listDocuments, needsReaccept, parityProblems, placeholdersIn, recordAcceptance, recordConsent, renderHtml, resolveTemplate, sha256Hex, sourceHash, templateHash, toBidHash, verifyTemplate };
package/dist/index.js CHANGED
@@ -182,6 +182,8 @@ function moduleFacts(p) {
182
182
  if (!m.revenueShare.length || Math.abs(total - 100) > 1e-9) throw new Error(`product "${p.id}": revenueShare must add up to 100 %, got ${total}`);
183
183
  return m;
184
184
  }
185
+ var GOOGLE_USER_DATA_POLICY = "https://developers.google.com/terms/api-services-user-data-policy";
186
+ var googleLimitedUse = (name) => `${name}'s use and transfer to any other app of information received from Google APIs will adhere to the Google API Services User Data Policy (${GOOGLE_USER_DATA_POLICY}), including the Limited Use requirements.`;
185
187
  var FACT_TEMPLATES = {
186
188
  da: {
187
189
  hosting: (p, id) => [{ id, type: "table", head: ["Hvad", "Hvor"], rows: p.hosting.map((h) => [h.what, h.where]) }],
@@ -196,6 +198,10 @@ var FACT_TEMPLATES = {
196
198
  text: p.conversationAnalysis ? `${p.name} er omfattet af afsnittet om analyse af samtaler.` : `${p.name} er ikke omfattet af afsnittet om analyse af samtaler.`
197
199
  }
198
200
  ],
201
+ googleApiLimitedUse: (p, id) => p.googleApiLimitedUse ? [
202
+ { id, type: "p", text: `${p.name} henter oplysninger fra Googles API'er. Googles egen erkl\xE6ring om brugen g\xE6lder og st\xE5r her ordret:` },
203
+ { id: `${id}.statement`, type: "p", text: googleLimitedUse(p.name) }
204
+ ] : [],
199
205
  moduleTerms: (p, id) => {
200
206
  const m = moduleFacts(p);
201
207
  return [{
@@ -230,6 +236,10 @@ var FACT_TEMPLATES = {
230
236
  text: p.conversationAnalysis ? `${p.name} is covered by the section on conversation analysis.` : `${p.name} is not covered by the section on conversation analysis.`
231
237
  }
232
238
  ],
239
+ googleApiLimitedUse: (p, id) => p.googleApiLimitedUse ? [
240
+ { id, type: "p", text: `${p.name} receives information from Google APIs. Google's own statement on that use applies, verbatim:` },
241
+ { id: `${id}.statement`, type: "p", text: googleLimitedUse(p.name) }
242
+ ] : [],
233
243
  moduleTerms: (p, id) => {
234
244
  const m = moduleFacts(p);
235
245
  return [{
@@ -293,7 +303,7 @@ function createLibrary(sources, products) {
293
303
  const src = byKey.get(`${opts.doc}:${opts.locale}`) ?? byKey.get(`${opts.doc}:${MASTER_LOCALE}`);
294
304
  if (!src) throw new Error(`no document "${opts.doc}"`);
295
305
  const master = byKey.get(`${opts.doc}:${MASTER_LOCALE}`);
296
- const stale = src.locale !== MASTER_LOCALE && (!src.translationOf || !master || src.translationOf.sourceHash !== sourceHash(master));
306
+ const stale = opts.stale ?? (src.locale !== MASTER_LOCALE && (!src.translationOf || !master || src.translationOf.sourceHash !== sourceHash(master)));
297
307
  const sections = src.sections.map((s) => ({
298
308
  id: s.id,
299
309
  heading: s.heading,
@@ -481,6 +491,7 @@ var PRIVACY_DA = {
481
491
  blocks: [
482
492
  { id: "deling.p1", type: "p", text: "Vi s\xE6lger aldrig data. Vi bruger disse databehandlere, som kun m\xE5 behandle oplysningerne efter vores instruks:" },
483
493
  { id: "deling.facts", type: "facts", fact: "subprocessors" },
494
+ { id: "deling.google", type: "facts", fact: "googleApiLimitedUse" },
484
495
  { id: "deling.p2", type: "p", text: "Overf\xF8rsel uden for EU sker kun med et gyldigt overf\xF8rselsgrundlag, fx EU-Kommissionens standardkontraktbestemmelser eller EU-US Data Privacy Framework." }
485
496
  ]
486
497
  },
@@ -999,7 +1010,7 @@ var PRIVACY_EN = {
999
1010
  effectiveFrom: "2026-11-02",
1000
1011
  material: false,
1001
1012
  draft: false,
1002
- translationOf: { version: "2026-11-02", sourceHash: "28f73420bd8c7fa77d22b17063746e4b71c03e4395be78fdb69100bc6282c4fe" },
1013
+ translationOf: { version: "2026-11-02", sourceHash: "c30a33c005888cd3dbbe62c462235fa31487f2b51821450ecb52e462578ddac6" },
1003
1014
  sections: [
1004
1015
  {
1005
1016
  id: "dataansvarlig",
@@ -1082,6 +1093,7 @@ var PRIVACY_EN = {
1082
1093
  blocks: [
1083
1094
  { id: "deling.p1", type: "p", text: "We never sell data. We use these processors, which may only process the information on our instructions:" },
1084
1095
  { id: "deling.facts", type: "facts", fact: "subprocessors" },
1096
+ { id: "deling.google", type: "facts", fact: "googleApiLimitedUse" },
1085
1097
  { id: "deling.p2", type: "p", text: "Transfers outside the EU only take place with a valid transfer mechanism, e.g. the European Commission's standard contractual clauses or the EU-US Data Privacy Framework." }
1086
1098
  ]
1087
1099
  },
@@ -1721,7 +1733,9 @@ function getDocument(opts) {
1721
1733
  }
1722
1734
  function resolveTemplate(template, facts) {
1723
1735
  const { doc, locale, title, version, effectiveFrom, material, draft, translationOf, sections } = template;
1724
- return createLibrary([{ doc, locale, title, version, effectiveFrom, material, draft, translationOf, sections }], [facts]).getDocument({ doc, locale, product: facts.id });
1736
+ const master = SOURCES.find((s) => s.doc === doc && s.locale === MASTER_LOCALE);
1737
+ const stale = "stale" in template && typeof template.stale === "boolean" ? template.stale : locale !== MASTER_LOCALE && (!master || translationOf?.sourceHash !== sourceHash(master));
1738
+ return createLibrary([{ doc, locale, title, version, effectiveFrom, material, draft, translationOf, sections }], [facts]).getDocument({ doc, locale, product: facts.id, stale });
1725
1739
  }
1726
1740
 
1727
1741
  export { BID_URL, BidConsentError, DEFAULT_REFRESH_MS, DOC_IDS, EXAMPLE_FACTS, LEGAL_API_URL, MASTER_LOCALE, PLACEHOLDERS, SOURCES, canonicalJson, createLegalCache, createLibrary, getAcceptance, getConsent, getDocument, getTemplate, listDocuments, needsReaccept, parityProblems, placeholdersIn, recordAcceptance, recordConsent, renderHtml, resolveTemplate, sha256Hex, sourceHash, templateHash, toBidHash, verifyTemplate };