@guinetik/primitives-ts 0.13.0 → 0.14.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.
@@ -75,20 +75,30 @@ export interface EmailVerifyResult {
75
75
  ok: boolean;
76
76
  error?: string;
77
77
  }
78
+ export type ApiKeyScope = 'email:send' | 'geo';
78
79
  /** API key metadata — never contains the full key. */
79
- export interface EmailApiKey {
80
+ export interface ApiKey {
80
81
  id: string;
81
82
  name: string;
82
83
  /** Free-form attribution label (e.g. agents@guinetik.com). Not an account link. */
83
84
  owner?: string;
85
+ scopes: ApiKeyScope[];
84
86
  prefix: string;
85
87
  createdAt: string;
86
88
  lastUsedAt?: string;
87
89
  }
88
90
  /** Returned once, at creation time only. */
89
- export interface EmailApiKeyCreated extends EmailApiKey {
91
+ export interface ApiKeyCreated extends ApiKey {
90
92
  key: string;
91
93
  }
94
+ /** @deprecated Use {@link ApiKey}. */
95
+ export type EmailApiKey = Omit<ApiKey, 'scopes'> & {
96
+ scopes?: ApiKeyScope[];
97
+ };
98
+ /** @deprecated Use {@link ApiKeyCreated}. */
99
+ export type EmailApiKeyCreated = EmailApiKey & {
100
+ key: string;
101
+ };
92
102
  /** email-providers doc. Secret fields stored as enc:v1:... strings. */
93
103
  export interface EmailProviderDocument extends FirestoreDocument {
94
104
  type: EmailProviderType;
@@ -108,4 +118,13 @@ export interface EmailApiKeyDocument extends FirestoreDocument {
108
118
  prefix: string;
109
119
  lastUsedAt?: Date;
110
120
  }
121
+ /** api-keys doc (shared collection, replaces email-api-keys). */
122
+ export interface ApiKeyDocument extends FirestoreDocument {
123
+ name: string;
124
+ owner?: string;
125
+ scopes: ApiKeyScope[];
126
+ keyHash: string;
127
+ prefix: string;
128
+ lastUsedAt?: Date;
129
+ }
111
130
  //# sourceMappingURL=email.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"email.types.d.ts","sourceRoot":"","sources":["../src/email.types.ts"],"names":[],"mappings":"AAAA;;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MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB;AAED,iEAAiE;AACjE,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB"}
@@ -0,0 +1,19 @@
1
+ /** A resolved place from the geo autocomplete service. */
2
+ export interface GeoLocation {
3
+ /** Display name as picked, e.g. "São José da Coroa Grande". */
4
+ name: string;
5
+ /** Secondary line, e.g. "Pernambuco, Brazil". */
6
+ region?: string;
7
+ lat: number;
8
+ lon: number;
9
+ /** IANA zone id derived server-side, e.g. "America/Recife". */
10
+ timeZone: string;
11
+ /** Google place id when resolved through Places. */
12
+ placeId?: string;
13
+ }
14
+ /** One autocomplete prediction; resolve via /geo/place/:placeId. */
15
+ export interface GeoSuggestion {
16
+ placeId: string;
17
+ description: string;
18
+ }
19
+ //# sourceMappingURL=geo.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geo.types.d.ts","sourceRoot":"","sources":["../src/geo.types.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,MAAM,WAAW,WAAW;IAC1B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,oEAAoE;AACpE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,19 +1,61 @@
1
- export type HomeWidgetType = 'launchpad' | 'clock' | 'webpage';
1
+ import type { GeoLocation } from './geo.types';
2
+ export type HomeWidgetType = "launchpad" | "clock" | "webpage" | "analytics" | "utility" | "news" | "weather" | "currency";
2
3
  export type HomeWidgetColSpan = 1 | 2 | 3;
3
4
  export interface LaunchpadWidgetConfig {
5
+ /** Launchpad group ids to show. Omitted on legacy widgets means all groups. */
6
+ groupIds?: string[];
4
7
  }
5
8
  export interface ClockWidgetConfig {
6
9
  timeZone: string;
7
10
  preset: string;
8
11
  /** Display the time on a 12-hour clock. Defaults to 24-hour when absent. */
9
12
  hour12?: boolean;
13
+ /** Resolved place. Legacy widgets have only timeZone. */
14
+ location?: GeoLocation;
10
15
  }
11
16
  export interface WebpageWidgetConfig {
12
17
  url: string;
13
18
  }
14
- export type HomeWidgetConfig = LaunchpadWidgetConfig | ClockWidgetConfig | WebpageWidgetConfig;
19
+ export interface AnalyticsWidgetConfig {
20
+ /** Saved GA4 property resource name, e.g. `properties/123456`. */
21
+ propertyId: string;
22
+ }
23
+ export declare const UTILITY_TOOL_IDS: readonly ["unit-converter", "text-workbench", "date-calculator"];
24
+ export type UtilityToolId = (typeof UTILITY_TOOL_IDS)[number];
25
+ /**
26
+ * Persisted utility selection and defaults. Interactive values remain local
27
+ * to the widget and are deliberately not written on every keystroke.
28
+ */
29
+ export interface UtilityWidgetConfig {
30
+ schemaVersion: 1;
31
+ toolId: UtilityToolId;
32
+ settings: Record<string, unknown>;
33
+ }
34
+ export interface NewsWidgetConfig {
35
+ /** Enabled provider to use. Omitted means the category default. */
36
+ providerId?: string;
37
+ limit: number;
38
+ /** Automatic feed refresh cadence in minutes. Omitted means 15 minutes. */
39
+ refreshMinutes?: number;
40
+ }
41
+ export interface WeatherWidgetConfig {
42
+ /** Enabled provider to use. Omitted means the category default. */
43
+ providerId?: string;
44
+ /** Resolved place; plain string on legacy widgets. */
45
+ location: string | GeoLocation;
46
+ }
47
+ export interface CurrencyWidgetConfig {
48
+ /** Enabled provider to use. Omitted means the category default. */
49
+ providerId?: string;
50
+ base: string;
51
+ quote: string;
52
+ defaultAmount: number;
53
+ }
54
+ export type HomeWidgetConfig = LaunchpadWidgetConfig | ClockWidgetConfig | WebpageWidgetConfig | AnalyticsWidgetConfig | UtilityWidgetConfig | NewsWidgetConfig | WeatherWidgetConfig | CurrencyWidgetConfig;
15
55
  export interface HomeDashboardWidget {
16
56
  id: string;
57
+ /** Optional user-defined chrome title. The widget type is used when omitted. */
58
+ title?: string;
17
59
  type: HomeWidgetType;
18
60
  colSpan: HomeWidgetColSpan;
19
61
  order: number;
@@ -27,6 +69,6 @@ export declare const HOME_WIDGET_TYPES: readonly HomeWidgetType[];
27
69
  export declare const MAX_HOME_WIDGETS = 30;
28
70
  export declare const CLOCK_DEFAULT_TIMEZONE = "America/Sao_Paulo";
29
71
  export declare const CLOCK_DEFAULT_PRESET = "aurora";
30
- export declare const CLOCK_PRESETS: readonly ["aurora", "grid", "binary"];
72
+ export declare const CLOCK_PRESETS: readonly ["aurora", "grid", "binary", "day-night", "location-photos"];
31
73
  export declare function isHomeWidgetType(value: string): value is HomeWidgetType;
32
74
  //# sourceMappingURL=home-dashboard.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"home-dashboard.types.d.ts","sourceRoot":"","sources":["../src/home-dashboard.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC;AAE/D,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE1C,MAAM,WAAW,qBAAqB;CAErC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MA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,CAAC;IACf,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,EAAE,mBAAmB,EAAE,CAAC;CAChC;AAED,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAStD,CAAC;AAEF,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,eAAO,MAAM,sBAAsB,sBAAsB,CAAC;AAE1D,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAE7C,eAAO,MAAM,aAAa,uEAMhB,CAAC;AAEX,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,cAAc,CAEvE"}
@@ -1,16 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CLOCK_PRESETS = exports.CLOCK_DEFAULT_PRESET = exports.CLOCK_DEFAULT_TIMEZONE = exports.MAX_HOME_WIDGETS = exports.HOME_WIDGET_TYPES = void 0;
3
+ exports.CLOCK_PRESETS = exports.CLOCK_DEFAULT_PRESET = exports.CLOCK_DEFAULT_TIMEZONE = exports.MAX_HOME_WIDGETS = exports.HOME_WIDGET_TYPES = exports.UTILITY_TOOL_IDS = void 0;
4
4
  exports.isHomeWidgetType = isHomeWidgetType;
5
+ exports.UTILITY_TOOL_IDS = [
6
+ "unit-converter",
7
+ "text-workbench",
8
+ "date-calculator",
9
+ ];
5
10
  exports.HOME_WIDGET_TYPES = [
6
- 'launchpad',
7
- 'clock',
8
- 'webpage',
11
+ "launchpad",
12
+ "clock",
13
+ "webpage",
14
+ "analytics",
15
+ "utility",
16
+ "news",
17
+ "weather",
18
+ "currency",
9
19
  ];
10
20
  exports.MAX_HOME_WIDGETS = 30;
11
- exports.CLOCK_DEFAULT_TIMEZONE = 'America/Sao_Paulo';
12
- exports.CLOCK_DEFAULT_PRESET = 'aurora';
13
- exports.CLOCK_PRESETS = ['aurora', 'grid', 'binary'];
21
+ exports.CLOCK_DEFAULT_TIMEZONE = "America/Sao_Paulo";
22
+ exports.CLOCK_DEFAULT_PRESET = "aurora";
23
+ exports.CLOCK_PRESETS = [
24
+ "aurora",
25
+ "grid",
26
+ "binary",
27
+ "day-night",
28
+ "location-photos",
29
+ ];
14
30
  function isHomeWidgetType(value) {
15
31
  return exports.HOME_WIDGET_TYPES.includes(value);
16
32
  }
@@ -2,33 +2,134 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const website_firestore_types_1 = require("./website-firestore.types");
4
4
  const home_dashboard_types_1 = require("./home-dashboard.types");
5
- describe('home dashboard types', () => {
6
- it('registers the Firestore collection', () => {
7
- expect(website_firestore_types_1.FIRESTORE_COLLECTIONS.HOME_DASHBOARDS).toBe('home-dashboards');
5
+ describe("home dashboard types", () => {
6
+ it("registers the Firestore collection", () => {
7
+ expect(website_firestore_types_1.FIRESTORE_COLLECTIONS.HOME_DASHBOARDS).toBe("home-dashboards");
8
8
  });
9
- it('accepts the three shipped types and rejects unknown ones', () => {
10
- expect(home_dashboard_types_1.HOME_WIDGET_TYPES).toEqual(['launchpad', 'clock', 'webpage']);
11
- expect((0, home_dashboard_types_1.isHomeWidgetType)('clock')).toBe(true);
12
- expect((0, home_dashboard_types_1.isHomeWidgetType)('weather')).toBe(false);
9
+ it("accepts the shipped types and rejects unknown ones", () => {
10
+ expect(home_dashboard_types_1.HOME_WIDGET_TYPES).toEqual([
11
+ "launchpad",
12
+ "clock",
13
+ "webpage",
14
+ "analytics",
15
+ "utility",
16
+ "news",
17
+ "weather",
18
+ "currency",
19
+ ]);
20
+ expect((0, home_dashboard_types_1.isHomeWidgetType)("clock")).toBe(true);
21
+ expect((0, home_dashboard_types_1.isHomeWidgetType)("analytics")).toBe(true);
22
+ expect((0, home_dashboard_types_1.isHomeWidgetType)("utility")).toBe(true);
23
+ expect((0, home_dashboard_types_1.isHomeWidgetType)("weather")).toBe(true);
24
+ expect((0, home_dashboard_types_1.isHomeWidgetType)("stock-ticker")).toBe(false);
13
25
  });
14
- it('caps a board at 30 widgets and defaults the clock', () => {
26
+ it("stores a versioned allowlisted utility configuration", () => {
27
+ const widget = {
28
+ id: "utility-1",
29
+ type: "utility",
30
+ colSpan: 2,
31
+ order: 0,
32
+ config: {
33
+ schemaVersion: 1,
34
+ toolId: "unit-converter",
35
+ settings: {
36
+ category: "length",
37
+ from: "meter",
38
+ to: "foot",
39
+ precision: 2,
40
+ },
41
+ },
42
+ };
43
+ expect(widget.config).toMatchObject({
44
+ schemaVersion: 1,
45
+ toolId: "unit-converter",
46
+ });
47
+ });
48
+ it("caps a board at 30 widgets and defaults the clock", () => {
15
49
  expect(home_dashboard_types_1.MAX_HOME_WIDGETS).toBe(30);
16
- expect(home_dashboard_types_1.CLOCK_DEFAULT_TIMEZONE).toBe('America/Sao_Paulo');
17
- expect(home_dashboard_types_1.CLOCK_DEFAULT_PRESET).toBe('aurora');
50
+ expect(home_dashboard_types_1.CLOCK_DEFAULT_TIMEZONE).toBe("America/Sao_Paulo");
51
+ expect(home_dashboard_types_1.CLOCK_DEFAULT_PRESET).toBe("aurora");
52
+ });
53
+ it("allows launchpad widgets to select groups while keeping legacy config valid", () => {
54
+ const legacy = {};
55
+ const selected = {
56
+ groupIds: ["infra", "publishing"],
57
+ };
58
+ expect(legacy.groupIds).toBeUndefined();
59
+ expect(selected.groupIds).toEqual(["infra", "publishing"]);
60
+ });
61
+ it("allows a widget to carry a custom title", () => {
62
+ const widget = {
63
+ id: "clock-1",
64
+ title: "São Paulo",
65
+ type: "clock",
66
+ colSpan: 1,
67
+ order: 0,
68
+ config: { timeZone: "America/Sao_Paulo", preset: "aurora" },
69
+ };
70
+ expect(widget.title).toBe("São Paulo");
71
+ });
72
+ it("stores the selected property on an Analytics widget", () => {
73
+ const widget = {
74
+ id: "analytics-1",
75
+ type: "analytics",
76
+ colSpan: 2,
77
+ order: 0,
78
+ config: { propertyId: "properties/123456" },
79
+ };
80
+ expect(widget.config).toEqual({ propertyId: "properties/123456" });
81
+ });
82
+ it("stores a news refresh cadence while keeping legacy configs valid", () => {
83
+ const legacy = { limit: 5 };
84
+ const refreshing = { limit: 5, refreshMinutes: 30 };
85
+ expect(legacy.refreshMinutes).toBeUndefined();
86
+ expect(refreshing.refreshMinutes).toBe(30);
18
87
  });
19
88
  });
20
- describe('clock presets', () => {
21
- it('includes the binary preset', () => {
22
- expect(home_dashboard_types_1.CLOCK_PRESETS).toContain('binary');
89
+ describe("clock presets", () => {
90
+ it("includes the location-aware backgrounds", () => {
91
+ expect(home_dashboard_types_1.CLOCK_PRESETS).toContain("day-night");
92
+ expect(home_dashboard_types_1.CLOCK_PRESETS).toContain("location-photos");
23
93
  });
24
- it('keeps aurora as the default and a member of the list', () => {
25
- expect(home_dashboard_types_1.CLOCK_DEFAULT_PRESET).toBe('aurora');
94
+ it("includes the binary preset", () => {
95
+ expect(home_dashboard_types_1.CLOCK_PRESETS).toContain("binary");
96
+ });
97
+ it("keeps aurora as the default and a member of the list", () => {
98
+ expect(home_dashboard_types_1.CLOCK_DEFAULT_PRESET).toBe("aurora");
26
99
  expect(home_dashboard_types_1.CLOCK_PRESETS).toContain(home_dashboard_types_1.CLOCK_DEFAULT_PRESET);
27
100
  });
28
- it('allows an optional hour12 flag on a clock config', () => {
29
- const twentyFour = { timeZone: 'UTC', preset: 'grid' };
30
- const twelve = { timeZone: 'UTC', preset: 'grid', hour12: true };
101
+ it("allows an optional hour12 flag on a clock config", () => {
102
+ const twentyFour = { timeZone: "UTC", preset: "grid" };
103
+ const twelve = {
104
+ timeZone: "UTC",
105
+ preset: "grid",
106
+ hour12: true,
107
+ };
31
108
  expect(twentyFour.hour12).toBeUndefined();
32
109
  expect(twelve.hour12).toBe(true);
33
110
  });
34
111
  });
112
+ describe("GeoLocation", () => {
113
+ it("accepts a resolved place and is assignable into widget configs", () => {
114
+ const loc = {
115
+ name: "São José da Coroa Grande",
116
+ region: "Pernambuco, Brazil",
117
+ lat: -8.8978,
118
+ lon: -35.1478,
119
+ timeZone: "America/Recife",
120
+ placeId: "ChIJexample",
121
+ };
122
+ const clock = {
123
+ timeZone: loc.timeZone,
124
+ preset: "aurora",
125
+ location: loc,
126
+ };
127
+ const weather = { location: loc };
128
+ expect(clock.location?.lat).toBeCloseTo(-8.8978);
129
+ expect(typeof weather.location === "string" ? "" : weather.location.name).toContain("Coroa");
130
+ });
131
+ it("weather still accepts a legacy string location", () => {
132
+ const weather = { location: "Cayenne" };
133
+ expect(weather.location).toBe("Cayenne");
134
+ });
135
+ });
package/dist/index.d.ts CHANGED
@@ -22,8 +22,10 @@ export * from './agent.types';
22
22
  export * from './file.types';
23
23
  export * from './launchpad.types';
24
24
  export * from './home-dashboard.types';
25
+ export * from './geo.types';
25
26
  export * from './email.types';
26
27
  export * from './analytics.types';
28
+ export * from './widget-services.types';
27
29
  export type { Security, SecurityChallengeOptions, SecurityChallengeResult } from './security.interface';
28
30
  export { SecurityLevel } from './security.interface';
29
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,cAAc,cAAc,CAAC;AAG7B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,cAAc,CAAC;AAG7B,cAAc,4BAA4B,CAAC;AAG3C,cAAc,gBAAgB,CAAC;AAG/B,cAAc,cAAc,CAAC;AAG7B,cAAc,eAAe,CAAC;AAG9B,cAAc,eAAe,CAAC;AAG9B,cAAc,cAAc,CAAC;AAG7B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,eAAe,CAAC;AAG9B,cAAc,mBAAmB,CAAC;AAGlC,YAAY,EAAE,QAAQ,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACxG,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,cAAc,cAAc,CAAC;AAG7B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,cAAc,CAAC;AAG7B,cAAc,4BAA4B,CAAC;AAG3C,cAAc,gBAAgB,CAAC;AAG/B,cAAc,cAAc,CAAC;AAG7B,cAAc,eAAe,CAAC;AAG9B,cAAc,eAAe,CAAC;AAG9B,cAAc,cAAc,CAAC;AAG7B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,aAAa,CAAC;AAG5B,cAAc,eAAe,CAAC;AAG9B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,yBAAyB,CAAC;AAGxC,YAAY,EAAE,QAAQ,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACxG,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -54,9 +54,13 @@ __exportStar(require("./file.types"), exports);
54
54
  __exportStar(require("./launchpad.types"), exports);
55
55
  // Per-user home dashboard widget types
56
56
  __exportStar(require("./home-dashboard.types"), exports);
57
+ // Geo autocomplete types
58
+ __exportStar(require("./geo.types"), exports);
57
59
  // Email module types
58
60
  __exportStar(require("./email.types"), exports);
59
61
  // Google Analytics portal types
60
62
  __exportStar(require("./analytics.types"), exports);
63
+ // Provider-backed dashboard widget types
64
+ __exportStar(require("./widget-services.types"), exports);
61
65
  var security_interface_1 = require("./security.interface");
62
66
  Object.defineProperty(exports, "SecurityLevel", { enumerable: true, get: function () { return security_interface_1.SecurityLevel; } });
@@ -0,0 +1,56 @@
1
+ /** Shared contracts for provider-backed dashboard widgets. */
2
+ export type WidgetServiceKind = "news" | "weather" | "currency";
3
+ export type WidgetServiceProviderType = "rss" | "open-meteo" | "frankfurter";
4
+ export type WidgetServiceResult<T> = {
5
+ ok: true;
6
+ value: T;
7
+ message?: string;
8
+ } | {
9
+ ok: false;
10
+ error: string;
11
+ };
12
+ export interface WidgetServiceProviderConfig {
13
+ id: string;
14
+ kind: WidgetServiceKind;
15
+ type: WidgetServiceProviderType;
16
+ name: string;
17
+ enabled: boolean;
18
+ active: boolean;
19
+ settings: Record<string, string | number | boolean>;
20
+ }
21
+ export interface NewsArticle {
22
+ title: string;
23
+ description: string;
24
+ url: string;
25
+ imageUrl?: string;
26
+ publishedAt?: string;
27
+ source: string;
28
+ }
29
+ export interface NewsFeed {
30
+ source: string;
31
+ articles: NewsArticle[];
32
+ fetchedAt: string;
33
+ }
34
+ export interface WeatherSnapshot {
35
+ location: string;
36
+ latitude: number;
37
+ longitude: number;
38
+ temperatureC: number;
39
+ apparentTemperatureC: number;
40
+ humidityPercent: number;
41
+ precipitationMm: number;
42
+ pressureHpa: number;
43
+ cloudCoverPercent: number;
44
+ windSpeedKph: number;
45
+ windDirectionDegrees: number;
46
+ weatherCode: number;
47
+ description: string;
48
+ observedAt: string;
49
+ }
50
+ export interface CurrencyRate {
51
+ base: string;
52
+ quote: string;
53
+ rate: number;
54
+ date: string;
55
+ }
56
+ //# sourceMappingURL=widget-services.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widget-services.types.d.ts","sourceRoot":"","sources":["../src/widget-services.types.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAChE,MAAM,MAAM,yBAAyB,GAAG,KAAK,GAAG,YAA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C;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=widget-services.types.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widget-services.types.spec.d.ts","sourceRoot":"","sources":["../src/widget-services.types.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ describe("widget service contracts", () => {
4
+ it("uses a normalized result boundary for every provider", () => {
5
+ const news = { ok: false, error: "offline" };
6
+ const currency = {
7
+ ok: true,
8
+ value: { base: "USD", quote: "EUR", rate: 0.86, date: "2026-09-02" },
9
+ };
10
+ const weather = {};
11
+ expect(news.ok).toBe(false);
12
+ expect(currency.ok).toBe(true);
13
+ expect(weather).toEqual({});
14
+ });
15
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guinetik/primitives-ts",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Shared TypeScript primitives for Guinetik projects",
5
5
  "author": "Guinetik",
6
6
  "license": "MIT",