@sammyleenug/plugin-sdk 0.0.0-stage → 0.1.1

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/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Temporary Holding Version
1
+ # @sammyleenug/plugin-sdk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Shared Vue 3 host integration for Umoja addons. Exports the plugin host, authenticated API client, company-aware registry, Plugin Foundation catalog and lifecycle service, marketplace normalization helpers, composables, types, error class, and native-looking UI primitives. Import `@sammyleenug/plugin-sdk/style.css` once in the host shell.
package/dist/api.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { UmojaApiClient, UmojaPluginHostOptions } from './types';
2
+ export declare function createApiClient(options: UmojaPluginHostOptions): UmojaApiClient;
3
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,cAAc,EACd,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAGjB,wBAAgB,eAAe,CAC7B,OAAO,EAAE,sBAAsB,GAC9B,cAAc,CAuEhB"}
@@ -0,0 +1,6 @@
1
+ import { CompanyPlugin, JsonObject, NormalizedPluginCatalogItem, PluginCatalogRecord, PluginManifest } from './types';
2
+ export declare function pluginIcon(pluginId: string, manifest?: Partial<PluginManifest>): string;
3
+ export declare function pluginPricingLabel(pricing?: JsonObject, formatPrice?: (amount: unknown, currency: unknown) => string): string;
4
+ export declare function normalizePluginCatalog(catalog?: PluginCatalogRecord[], installed?: CompanyPlugin[], formatPrice?: (amount: unknown, currency: unknown) => string): NormalizedPluginCatalogItem[];
5
+ export declare function pluginActionLabel(plugin: NormalizedPluginCatalogItem): string;
6
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,2BAA2B,EAC3B,mBAAmB,EACnB,cAAc,EACf,MAAM,SAAS,CAAC;AAUjB,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GACjC,MAAM,CAKR;AAED,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,UAAe,EACxB,WAAW,GAAE,CACX,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,OAAO,KACd,MAA8B,GAClC,MAAM,CAWR;AAUD,wBAAgB,sBAAsB,CACpC,OAAO,GAAE,mBAAmB,EAAO,EACnC,SAAS,GAAE,aAAa,EAAO,EAC/B,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK,MAAM,GAC3D,2BAA2B,EAAE,CAmD/B;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,2BAA2B,GAAG,MAAM,CAM7E"}
@@ -0,0 +1,21 @@
1
+ type __VLS_Props = {
2
+ title?: string;
3
+ message?: string;
4
+ icon?: string;
5
+ };
6
+ declare const __VLS_template: () => {
7
+ __VLS_Slots: {
8
+ actions?: (props: {}) => any;
9
+ };
10
+ };
11
+ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
12
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
21
+ //# sourceMappingURL=UmojaEmptyState.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UmojaEmptyState.vue.d.ts","sourceRoot":"","sources":["../../src/components/UmojaEmptyState.vue"],"names":[],"mappings":"AAiBA,KAAK,WAAW,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAevE,QAAA,MAAM,cAAc;;kBAoBN,CAAC,KAAK,IAAgB,KAAK,GAAG;;CAM3C,CAAC;AACF,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,aAAa,CAAC,CAAC;AAEpE,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -0,0 +1,7 @@
1
+ type __VLS_Props = {
2
+ label?: string;
3
+ };
4
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
7
+ //# sourceMappingURL=UmojaLoadingState.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UmojaLoadingState.vue.d.ts","sourceRoot":"","sources":["../../src/components/UmojaLoadingState.vue"],"names":[],"mappings":"AAmBA,KAAK,WAAW,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA2CtC,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,10 @@
1
+ type __VLS_Props = {
2
+ label: string;
3
+ value: string | number;
4
+ icon: string;
5
+ hint?: string;
6
+ };
7
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
10
+ //# sourceMappingURL=UmojaMetricCard.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UmojaMetricCard.vue.d.ts","sourceRoot":"","sources":["../../src/components/UmojaMetricCard.vue"],"names":[],"mappings":"AAuBA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AA+CF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,20 @@
1
+ type __VLS_Props = {
2
+ title: string;
3
+ subtitle?: string;
4
+ };
5
+ declare const __VLS_template: () => {
6
+ __VLS_Slots: {
7
+ actions?: (props: {}) => any;
8
+ };
9
+ };
10
+ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
11
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
20
+ //# sourceMappingURL=UmojaPageHeader.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UmojaPageHeader.vue.d.ts","sourceRoot":"","sources":["../../src/components/UmojaPageHeader.vue"],"names":[],"mappings":"AAoBA,KAAK,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAexD,QAAA,MAAM,cAAc;;kBAyBN,CAAC,KAAK,IAAgB,KAAK,GAAG;;CAM3C,CAAC;AACF,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,aAAa,CAAC,CAAC;AAEpE,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { Ref } from 'vue';
2
+ export declare function useUmojaPluginContext(): import('./types').UmojaPluginContext;
3
+ /** Concise alias for host-shell components. */
4
+ export declare const usePluginContext: typeof useUmojaPluginContext;
5
+ export declare function usePluginApi(): import('./types').UmojaApiClient;
6
+ export declare function usePluginAccess(pluginId: string, permission?: string): {
7
+ access: import('vue').ComputedRef<import('./types').PluginAccessState>;
8
+ allowed: import('vue').ComputedRef<boolean>;
9
+ reason: import('vue').ComputedRef<string | undefined>;
10
+ };
11
+ export declare function usePluginConfiguration(pluginId: string): {
12
+ load: () => Promise<import('./types').JsonObject>;
13
+ save: (configuration: Record<string, unknown>, secrets?: Record<string, unknown>) => Promise<import('./types').JsonObject>;
14
+ };
15
+ export declare function useAsyncResource<T>(loader: () => Promise<T>): {
16
+ data: Ref<T | null, T | null>;
17
+ loading: Ref<boolean, boolean>;
18
+ error: Ref<Error | null, Error | null>;
19
+ load: () => Promise<T>;
20
+ };
21
+ //# sourceMappingURL=composables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composables.d.ts","sourceRoot":"","sources":["../src/composables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAGtD,wBAAgB,qBAAqB,yCAIpC;AAED,+CAA+C;AAC/C,eAAO,MAAM,gBAAgB,8BAAwB,CAAC;AAEtD,wBAAgB,YAAY,qCAE3B;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;;;;EAQpE;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM;;0BAKlC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;EAGtC;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC;;;;;EAkB3D"}
@@ -0,0 +1,21 @@
1
+ import { CompanyPlugin, FrontendDiscoveryResponse, JsonObject, PluginCatalogRecord, PluginFoundationService, PluginSubscriptionRequest, UmojaApiClient } from './types';
2
+ export declare class DefaultPluginFoundationService implements PluginFoundationService {
3
+ private readonly api;
4
+ constructor(api: UmojaApiClient);
5
+ catalog(): Promise<PluginCatalogRecord[]>;
6
+ installed(): Promise<CompanyPlugin[]>;
7
+ frontend(): Promise<FrontendDiscoveryResponse>;
8
+ configuration(pluginId: string): Promise<JsonObject>;
9
+ updateConfiguration(pluginId: string, payload: JsonObject): Promise<JsonObject>;
10
+ subscription(pluginId: string): Promise<JsonObject>;
11
+ install(pluginId: string, version?: string | null): Promise<CompanyPlugin>;
12
+ activate(pluginId: string): Promise<CompanyPlugin>;
13
+ deactivate(pluginId: string): Promise<CompanyPlugin>;
14
+ suspend(pluginId: string, reason: string): Promise<CompanyPlugin>;
15
+ resume(pluginId: string): Promise<CompanyPlugin>;
16
+ upgrade(pluginId: string, version: string): Promise<CompanyPlugin>;
17
+ uninstall(pluginId: string): Promise<JsonObject>;
18
+ updateSubscription(pluginId: string, payload?: PluginSubscriptionRequest): Promise<JsonObject>;
19
+ contracts(): Promise<JsonObject>;
20
+ }
21
+ //# sourceMappingURL=foundation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foundation.d.ts","sourceRoot":"","sources":["../src/foundation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,yBAAyB,EACzB,UAAU,EACV,mBAAmB,EACnB,uBAAuB,EACvB,yBAAyB,EACzB,cAAc,EACf,MAAM,SAAS,CAAC;AAEjB,qBAAa,8BAA+B,YAAW,uBAAuB;IAChE,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,cAAc;IAEhD,OAAO,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAIzC,SAAS,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAIrC,QAAQ,IAAI,OAAO,CAAC,yBAAyB,CAAC;IAI9C,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAMpD,mBAAmB,CACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,UAAU,CAAC;IAOtB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAMnD,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC;IAS1E,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAMlD,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAMpD,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IASjE,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIhD,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IASlE,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAIhD,kBAAkB,CAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,UAAU,CAAC;IAatB,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC;CAGjC"}
package/dist/host.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { App } from 'vue';
2
+ import { PluginInstallOptions, UmojaFrontendPluginDescriptor, UmojaPluginHost, UmojaPluginHostOptions } from './types';
3
+ export declare function createUmojaPluginHost(options: UmojaPluginHostOptions): UmojaPluginHost;
4
+ export declare function defineUmojaPlugin(descriptor: UmojaFrontendPluginDescriptor): {
5
+ descriptor: UmojaFrontendPluginDescriptor;
6
+ install(app: App, options?: PluginInstallOptions): Promise<void>;
7
+ };
8
+ declare module "@vue/runtime-core" {
9
+ interface ComponentCustomProperties {
10
+ $umojaPlugins: ReturnType<typeof createUmojaPluginHost>["context"];
11
+ $umojaPluginsHost?: UmojaPluginHost;
12
+ }
13
+ }
14
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAI/B,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC5B,MAAM,SAAS,CAAC;AAEjB,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,sBAAsB,GAC9B,eAAe,CA4CjB;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,6BAA6B;;iBAGpD,GAAG,YAAW,oBAAoB;EAaxD;AAED,OAAO,QAAQ,mBAAmB,CAAC;IACjC,UAAU,yBAAyB;QACjC,aAAa,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,SAAS,CAAC,CAAC;QACnE,iBAAiB,CAAC,EAAE,eAAe,CAAC;KACrC;CACF"}
@@ -0,0 +1,12 @@
1
+ export * from './api';
2
+ export * from './catalog';
3
+ export * from './composables';
4
+ export * from './foundation';
5
+ export * from './host';
6
+ export * from './registry';
7
+ export * from './types';
8
+ export { default as UmojaEmptyState } from './components/UmojaEmptyState.vue';
9
+ export { default as UmojaLoadingState } from './components/UmojaLoadingState.vue';
10
+ export { default as UmojaMetricCard } from './components/UmojaMetricCard.vue';
11
+ export { default as UmojaPageHeader } from './components/UmojaPageHeader.vue';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAErB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,kCAAkC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,439 @@
1
+ var x = Object.defineProperty;
2
+ var T = (e, t, n) => t in e ? x(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var j = (e, t, n) => T(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { ref as P, computed as U, inject as B, defineComponent as y, openBlock as f, createElementBlock as b, createElementVNode as p, normalizeClass as R, toDisplayString as g, renderSlot as E, createVNode as z, unref as N, createCommentVNode as S } from "vue";
5
+ import L from "primevue/progressspinner";
6
+ const A = Symbol(
7
+ "umoja-plugin-context"
8
+ );
9
+ class H extends Error {
10
+ constructor(t, n, i) {
11
+ super(t), this.status = n, this.details = i, this.name = "UmojaApiError";
12
+ }
13
+ }
14
+ function M(e) {
15
+ const t = e.fetch ?? globalThis.fetch.bind(globalThis), n = (e.apiBaseUrl ?? "").replace(/\/$/, "");
16
+ async function i(o, a = {}) {
17
+ var d, _, C, k;
18
+ const s = e.getAuth(), r = new URL(
19
+ `${n}${o}`,
20
+ n || ((d = globalThis.location) == null ? void 0 : d.origin) || "http://localhost"
21
+ );
22
+ for (const [v, h] of Object.entries(a.query ?? {}))
23
+ h != null && h !== "" && r.searchParams.set(v, String(h));
24
+ const u = new Headers(a.headers), m = a.serializeBody ?? !0;
25
+ !u.has("Content-Type") && a.body !== void 0 && m && u.set("Content-Type", "application/json"), s.token && u.set("Authorization", `Bearer ${s.token}`), s.companyId && u.set("X-Company-Id", s.companyId);
26
+ const c = await t(r, {
27
+ ...a,
28
+ headers: u,
29
+ credentials: a.credentials ?? "include",
30
+ body: a.body === void 0 ? void 0 : m ? JSON.stringify(a.body) : a.body
31
+ });
32
+ if (c.ok && a.responseType === "response")
33
+ return c;
34
+ if (c.ok && a.responseType === "blob")
35
+ return await c.blob();
36
+ if (c.ok && a.responseType === "text")
37
+ return await c.text();
38
+ const l = c.status === 204 ? null : await c.json().catch(() => null);
39
+ if (!c.ok || l && l.success === !1) {
40
+ const v = (l == null ? void 0 : l.error) ?? (l == null ? void 0 : l.message) ?? `Request failed with status ${c.status}`, h = new H(v, c.status, l);
41
+ throw c.status === 401 && ((_ = e.onUnauthorized) == null || _.call(e)), c.status === 403 && /subscription/i.test(v) && ((C = e.onSubscriptionRequired) == null || C.call(e)), (k = e.onError) == null || k.call(e, h), h;
42
+ }
43
+ return a.raw ? l : D(l) ? l.data : l;
44
+ }
45
+ return {
46
+ request: i,
47
+ get: (o, a) => i(o, { method: "GET", query: a }),
48
+ post: (o, a) => i(o, { method: "POST", body: a }),
49
+ put: (o, a) => i(o, { method: "PUT", body: a }),
50
+ patch: (o, a) => i(o, { method: "PATCH", body: a }),
51
+ delete: (o) => i(o, { method: "DELETE" })
52
+ };
53
+ }
54
+ function D(e) {
55
+ return !!(e && typeof e == "object" && "success" in e && "data" in e);
56
+ }
57
+ const F = Object.freeze({
58
+ sms: "pi pi-mobile",
59
+ "custom-emails": "pi pi-envelope",
60
+ "ai-assistant": "pi pi-sparkles",
61
+ "google-drive": "pi pi-cloud",
62
+ "workflows-automation": "pi pi-sitemap"
63
+ });
64
+ function G(e, t) {
65
+ var i, o, a;
66
+ return ((a = (o = (i = t == null ? void 0 : t.frontend) == null ? void 0 : i.navigation) == null ? void 0 : o.find(
67
+ (s) => s.icon
68
+ )) == null ? void 0 : a.icon) || F[e] || "pi pi-puzzle-piece";
69
+ }
70
+ function V(e = {}, t = X) {
71
+ switch (e.type) {
72
+ case "fixed":
73
+ return `${t(e.amount, e.currency)}${I(e.billing_cycle)}`;
74
+ case "usage_based":
75
+ return `${t(e.unit_amount, e.currency)} per ${$(e.unit)}${J(e.billing_cycle)}`;
76
+ case "hybrid":
77
+ return `${t(e.base_amount, e.currency)}${I(e.billing_cycle)} + usage`;
78
+ default:
79
+ return "Free";
80
+ }
81
+ }
82
+ function I(e) {
83
+ return e ? ` / ${$(e)}` : "";
84
+ }
85
+ function J(e) {
86
+ return e ? `, billed ${$(e)}` : "";
87
+ }
88
+ function re(e = [], t = [], n) {
89
+ const i = new Map(
90
+ t.map((s) => [s.plugin_id, s])
91
+ ), o = new Set(e.map((s) => s.plugin_id));
92
+ return [
93
+ ...e,
94
+ ...t.filter((s) => !o.has(s.plugin_id)).map((s) => ({
95
+ plugin_id: s.plugin_id,
96
+ version: s.version,
97
+ name: s.manifest.name,
98
+ description: s.manifest.description,
99
+ manifest: s.manifest,
100
+ is_current: !0,
101
+ is_available: !1,
102
+ created_at: ""
103
+ }))
104
+ ].map((s) => {
105
+ const r = i.get(s.plugin_id) ?? null, u = (r == null ? void 0 : r.manifest) ?? s.manifest, m = (r == null ? void 0 : r.subscription_status) ?? null, c = (r == null ? void 0 : r.status) ?? "available", l = !!m, d = m === "active";
106
+ return {
107
+ id: s.plugin_id,
108
+ version: (r == null ? void 0 : r.version) ?? s.version,
109
+ name: s.name || u.name || $(s.plugin_id),
110
+ description: s.description || u.description || "Extend Umoja with an optional capability.",
111
+ icon: G(s.plugin_id, u),
112
+ pricing: u.pricing ?? { type: "free" },
113
+ priceLabel: V(u.pricing, n),
114
+ capabilities: Array.isArray(u.capabilities) ? u.capabilities : [],
115
+ installation: r,
116
+ lifecycleStatus: c,
117
+ subscriptionStatus: m,
118
+ subscribed: l,
119
+ entitled: d,
120
+ active: c === "active" && d,
121
+ setupRequired: d && c !== "active"
122
+ };
123
+ });
124
+ }
125
+ function ue(e) {
126
+ return e.active ? "Subscribed" : e.subscriptionStatus === "pending_payment" ? "Payment pending" : e.setupRequired ? "Setup required" : e.subscribed ? "Resume subscription" : "Subscribe";
127
+ }
128
+ function $(e) {
129
+ return String(e || "").replaceAll("_", " ").replaceAll("-", " ").replace(/\b\w/g, (t) => t.toUpperCase());
130
+ }
131
+ function X(e, t) {
132
+ return `${String(t || "")} ${String(e || 0)}`.trim();
133
+ }
134
+ function w() {
135
+ const e = B(A);
136
+ if (!e) throw new Error("Umoja plugin host is not installed");
137
+ return e;
138
+ }
139
+ const ce = w;
140
+ function le() {
141
+ return w().api;
142
+ }
143
+ function de(e, t) {
144
+ const n = w(), i = U(() => n.registry.access(e, t));
145
+ return {
146
+ access: i,
147
+ allowed: U(() => i.value.allowed),
148
+ reason: U(() => i.value.reason)
149
+ };
150
+ }
151
+ function pe(e) {
152
+ const { foundation: t } = w();
153
+ return {
154
+ load: () => t.configuration(e),
155
+ save: (n, i) => t.updateConfiguration(e, { configuration: n, secrets: i })
156
+ };
157
+ }
158
+ function me(e) {
159
+ const t = P(null), n = P(!1), i = P(null);
160
+ async function o() {
161
+ n.value = !0, i.value = null;
162
+ try {
163
+ return t.value = await e(), t.value;
164
+ } catch (a) {
165
+ throw i.value = a instanceof Error ? a : new Error(String(a)), i.value;
166
+ } finally {
167
+ n.value = !1;
168
+ }
169
+ }
170
+ return { data: t, loading: n, error: i, load: o };
171
+ }
172
+ class K {
173
+ constructor(t) {
174
+ this.api = t;
175
+ }
176
+ catalog() {
177
+ return this.api.get("/api/plugins/catalog");
178
+ }
179
+ installed() {
180
+ return this.api.get("/api/plugins");
181
+ }
182
+ frontend() {
183
+ return this.api.get("/api/plugins/frontend");
184
+ }
185
+ configuration(t) {
186
+ return this.api.get(
187
+ `/api/plugins/${encodeURIComponent(t)}/configuration`
188
+ );
189
+ }
190
+ updateConfiguration(t, n) {
191
+ return this.api.put(
192
+ `/api/plugins/${encodeURIComponent(t)}/configuration`,
193
+ n
194
+ );
195
+ }
196
+ subscription(t) {
197
+ return this.api.get(
198
+ `/api/plugins/${encodeURIComponent(t)}/subscription`
199
+ );
200
+ }
201
+ install(t, n) {
202
+ return this.api.post(
203
+ `/api/plugins/${encodeURIComponent(t)}/install`,
204
+ {
205
+ version: n ?? null
206
+ }
207
+ );
208
+ }
209
+ activate(t) {
210
+ return this.api.post(
211
+ `/api/plugins/${encodeURIComponent(t)}/activate`
212
+ );
213
+ }
214
+ deactivate(t) {
215
+ return this.api.post(
216
+ `/api/plugins/${encodeURIComponent(t)}/deactivate`
217
+ );
218
+ }
219
+ suspend(t, n) {
220
+ return this.api.post(
221
+ `/api/plugins/${encodeURIComponent(t)}/suspend`,
222
+ {
223
+ reason: n
224
+ }
225
+ );
226
+ }
227
+ resume(t) {
228
+ return this.api.post(`/api/plugins/${encodeURIComponent(t)}/resume`);
229
+ }
230
+ upgrade(t, n) {
231
+ return this.api.post(
232
+ `/api/plugins/${encodeURIComponent(t)}/upgrade`,
233
+ {
234
+ version: n
235
+ }
236
+ );
237
+ }
238
+ uninstall(t) {
239
+ return this.api.delete(`/api/plugins/${encodeURIComponent(t)}`);
240
+ }
241
+ updateSubscription(t, n = {}) {
242
+ return this.api.put(
243
+ `/api/plugins/${encodeURIComponent(t)}/subscription`,
244
+ {
245
+ usage_limit: null,
246
+ period_ends_at: null,
247
+ core_subscription_id: null,
248
+ metadata: {},
249
+ ...n
250
+ }
251
+ );
252
+ }
253
+ contracts() {
254
+ return this.api.get("/api/plugins/contracts");
255
+ }
256
+ }
257
+ class Q {
258
+ constructor(t) {
259
+ j(this, "descriptors", /* @__PURE__ */ new Map());
260
+ j(this, "backend", /* @__PURE__ */ new Map());
261
+ this.auth = t;
262
+ }
263
+ register(t) {
264
+ this.descriptors.has(t.id) || this.descriptors.set(t.id, t);
265
+ }
266
+ get(t) {
267
+ return this.descriptors.get(t);
268
+ }
269
+ all() {
270
+ return [...this.descriptors.values()];
271
+ }
272
+ navigation() {
273
+ return this.all().filter((t) => this.access(t.id).allowed).flatMap(
274
+ (t) => t.navigation.filter(
275
+ (n) => this.hasPermission(n.required_permission)
276
+ )
277
+ ).sort((t, n) => t.order - n.order);
278
+ }
279
+ setBackendState(t) {
280
+ this.backend.clear(), t.forEach((n) => this.backend.set(n.plugin_id, n));
281
+ }
282
+ access(t, n) {
283
+ const i = this.backend.get(t), o = !!(i && i.status !== "uninstalled"), a = (i == null ? void 0 : i.status) === "active", s = (i == null ? void 0 : i.subscription_status) === "active" && !W(i == null ? void 0 : i.period_ends_at), r = !n || this.hasPermission(n), u = o && a && s && r;
284
+ return {
285
+ installed: o,
286
+ active: a,
287
+ entitled: s,
288
+ allowed: u,
289
+ reason: u ? void 0 : o ? a ? s ? "Permission is required" : "Plugin subscription is not entitled" : "Plugin is not active" : "Plugin is not installed"
290
+ };
291
+ }
292
+ hasPermission(t) {
293
+ const n = this.auth();
294
+ return !!(n.isSuperAdmin || n.permissions.includes(t));
295
+ }
296
+ }
297
+ function W(e) {
298
+ return !!(e && new Date(e).getTime() <= Date.now());
299
+ }
300
+ function ge(e) {
301
+ const t = M(e), n = new Q(e.getAuth), i = new K(t), o = { api: t, registry: n, foundation: i, auth: e.getAuth };
302
+ async function a(r, u, m = {}) {
303
+ var l;
304
+ n.register(u);
305
+ for (const [d, _] of Object.entries(
306
+ u.components ?? {}
307
+ ))
308
+ r.component(d, _);
309
+ const c = e.router;
310
+ if (c)
311
+ for (const d of u.routes)
312
+ c.hasRoute(String(d.name)) || (m.routeParentName ? c.addRoute(m.routeParentName, d) : c.addRoute(d));
313
+ await ((l = u.initialize) == null ? void 0 : l.call(u, o));
314
+ }
315
+ const s = {
316
+ context: o,
317
+ async install(r) {
318
+ r.provide(A, o), r.config.globalProperties.$umojaPlugins = o, r.config.globalProperties.$umojaPluginsHost = s;
319
+ try {
320
+ n.setBackendState(await i.installed());
321
+ } catch {
322
+ n.setBackendState([]);
323
+ }
324
+ },
325
+ installPlugin: a
326
+ };
327
+ return s;
328
+ }
329
+ function he(e) {
330
+ return {
331
+ descriptor: e,
332
+ async install(t, n = {}) {
333
+ const i = n.host ?? t.config.globalProperties.$umojaPluginsHost;
334
+ if (!i)
335
+ throw new Error(
336
+ `Install the Umoja plugin host before ${e.name}, or pass { host } to app.use().`
337
+ );
338
+ await i.installPlugin(t, e, n);
339
+ }
340
+ };
341
+ }
342
+ const Y = { class: "umoja-card umoja-empty-state" }, fe = /* @__PURE__ */ y({
343
+ __name: "UmojaEmptyState",
344
+ props: {
345
+ title: {},
346
+ message: {},
347
+ icon: {}
348
+ },
349
+ setup(e) {
350
+ return (t, n) => (f(), b("div", Y, [
351
+ p("i", {
352
+ class: R([e.icon ?? "pi pi-inbox", "umoja-empty-state__icon"])
353
+ }, null, 2),
354
+ p("strong", null, g(e.title ?? "No records found"), 1),
355
+ p("p", null, g(e.message ?? "There is nothing to show yet."), 1),
356
+ E(t.$slots, "actions")
357
+ ]));
358
+ }
359
+ }), Z = { class: "umoja-card umoja-state" }, be = /* @__PURE__ */ y({
360
+ __name: "UmojaLoadingState",
361
+ props: {
362
+ label: {}
363
+ },
364
+ setup(e) {
365
+ return (t, n) => (f(), b("div", Z, [
366
+ z(N(L), {
367
+ style: { width: "2rem", height: "2rem" },
368
+ "stroke-width": "4"
369
+ }),
370
+ p("span", null, g(e.label ?? "Loading"), 1)
371
+ ]));
372
+ }
373
+ }), q = { class: "umoja-card umoja-metric-card" }, O = { class: "umoja-icon" }, ee = { key: 0 }, _e = /* @__PURE__ */ y({
374
+ __name: "UmojaMetricCard",
375
+ props: {
376
+ label: {},
377
+ value: {},
378
+ icon: {},
379
+ hint: {}
380
+ },
381
+ setup(e) {
382
+ return (t, n) => (f(), b("article", q, [
383
+ p("span", O, [
384
+ p("i", {
385
+ class: R(e.icon)
386
+ }, null, 2)
387
+ ]),
388
+ p("div", null, [
389
+ p("span", null, g(e.label), 1),
390
+ p("strong", null, g(e.value), 1),
391
+ e.hint ? (f(), b("small", ee, g(e.hint), 1)) : S("", !0)
392
+ ])
393
+ ]));
394
+ }
395
+ }), te = { class: "umoja-page-header" }, ne = { key: 0 }, ie = {
396
+ key: 0,
397
+ class: "umoja-page-header__actions"
398
+ }, ve = /* @__PURE__ */ y({
399
+ __name: "UmojaPageHeader",
400
+ props: {
401
+ title: {},
402
+ subtitle: {}
403
+ },
404
+ setup(e) {
405
+ return (t, n) => (f(), b("div", te, [
406
+ p("div", null, [
407
+ p("h1", null, g(e.title), 1),
408
+ e.subtitle ? (f(), b("p", ne, g(e.subtitle), 1)) : S("", !0)
409
+ ]),
410
+ t.$slots.actions ? (f(), b("div", ie, [
411
+ E(t.$slots, "actions")
412
+ ])) : S("", !0)
413
+ ]));
414
+ }
415
+ });
416
+ export {
417
+ K as DefaultPluginFoundationService,
418
+ Q as DefaultPluginRegistry,
419
+ A as UMOJA_PLUGIN_CONTEXT,
420
+ H as UmojaApiError,
421
+ fe as UmojaEmptyState,
422
+ be as UmojaLoadingState,
423
+ _e as UmojaMetricCard,
424
+ ve as UmojaPageHeader,
425
+ M as createApiClient,
426
+ ge as createUmojaPluginHost,
427
+ he as defineUmojaPlugin,
428
+ re as normalizePluginCatalog,
429
+ ue as pluginActionLabel,
430
+ G as pluginIcon,
431
+ V as pluginPricingLabel,
432
+ me as useAsyncResource,
433
+ de as usePluginAccess,
434
+ le as usePluginApi,
435
+ pe as usePluginConfiguration,
436
+ ce as usePluginContext,
437
+ w as useUmojaPluginContext
438
+ };
439
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/types.ts","../src/api.ts","../src/catalog.ts","../src/composables.ts","../src/foundation.ts","../src/registry.ts","../src/host.ts","../src/components/UmojaEmptyState.vue","../src/components/UmojaLoadingState.vue","../src/components/UmojaMetricCard.vue","../src/components/UmojaPageHeader.vue"],"sourcesContent":["import type { App, Component, InjectionKey } from \"vue\";\nimport type { RouteRecordRaw, Router } from \"vue-router\";\n\nexport type JsonObject = Record<string, unknown>;\nexport type PluginStatus =\n \"installed\" | \"active\" | \"inactive\" | \"suspended\" | \"uninstalled\";\nexport type SubscriptionStatus =\n \"active\" | \"pending_payment\" | \"expired\" | \"cancelled\" | null;\n\nexport interface ApiEnvelope<T> {\n success: boolean;\n data: T;\n error?: string;\n}\n\nexport interface PaginatedResponse<T> {\n success?: boolean;\n data: T[];\n page: number;\n per_page: number;\n total: number;\n total_pages: number;\n}\n\nexport interface PluginCapability {\n key: string;\n name: string;\n description: string;\n input_schema: JsonObject;\n output_schema: JsonObject;\n}\n\nexport interface NavigationContribution {\n key: string;\n label: string;\n path: string;\n icon?: string | null;\n required_permission: string;\n order: number;\n}\n\nexport interface PluginManifest {\n contract_version: string;\n id: string;\n name: string;\n version: string;\n description: string;\n capabilities: PluginCapability[];\n permissions: Array<{ name: string; description: string }>;\n configuration_schema: JsonObject;\n frontend: {\n navigation: NavigationContribution[];\n contextual_actions: JsonObject[];\n configuration_ui?: { kind: string; entrypoint?: string | null } | null;\n };\n pricing: JsonObject;\n}\n\nexport interface CompanyPlugin {\n id: string;\n company_id: string;\n plugin_id: string;\n version: string;\n status: PluginStatus;\n manifest: PluginManifest;\n subscription_status: SubscriptionStatus;\n period_ends_at?: string | null;\n is_configured: boolean;\n}\n\nexport interface PluginCatalogRecord {\n plugin_id: string;\n version: string;\n name: string;\n description: string;\n manifest: PluginManifest;\n is_current: boolean;\n is_available: boolean;\n created_at: string;\n}\n\nexport interface PluginSubscriptionRequest {\n usage_limit?: number | null;\n period_ends_at?: string | null;\n core_subscription_id?: string | null;\n metadata?: JsonObject;\n}\n\nexport interface NormalizedPluginCatalogItem {\n id: string;\n version: string;\n name: string;\n description: string;\n icon: string;\n pricing: JsonObject;\n priceLabel: string;\n capabilities: PluginCapability[];\n installation: CompanyPlugin | null;\n lifecycleStatus: string;\n subscriptionStatus: SubscriptionStatus;\n subscribed: boolean;\n entitled: boolean;\n active: boolean;\n setupRequired: boolean;\n}\n\nexport interface FrontendPlugin {\n plugin_id: string;\n name: string;\n version: string;\n navigation: NavigationContribution[];\n contextual_actions: JsonObject[];\n configuration_ui?: JsonObject | null;\n}\n\nexport interface FrontendDiscoveryResponse {\n plugins: FrontendPlugin[];\n}\n\nexport interface AuthContext {\n token: string | null;\n userId?: string | null;\n companyId: string | null;\n permissions: string[];\n isSuperAdmin?: boolean;\n}\n\nexport interface PluginRoute extends Omit<RouteRecordRaw, \"children\"> {\n children?: PluginRoute[];\n}\n\nexport interface UmojaFrontendPluginDescriptor {\n id: string;\n name: string;\n version: string;\n routes: RouteRecordRaw[];\n navigation: NavigationContribution[];\n components?: Record<string, Component>;\n capabilities?: string[];\n initialize?: (context: UmojaPluginContext) => void | Promise<void>;\n}\n\nexport interface PluginAccessState {\n installed: boolean;\n active: boolean;\n entitled: boolean;\n allowed: boolean;\n reason?: string;\n}\n\nexport interface UmojaPluginHostOptions {\n apiBaseUrl?: string;\n router?: Router;\n getAuth: () => AuthContext;\n fetch?: typeof globalThis.fetch;\n onUnauthorized?: () => void;\n onSubscriptionRequired?: () => void;\n onError?: (error: UmojaApiError) => void;\n}\n\nexport interface PluginInstallOptions {\n host?: UmojaPluginHost;\n routeParentName?: string;\n}\n\nexport interface UmojaPluginContext {\n api: UmojaApiClient;\n registry: UmojaPluginRegistry;\n foundation: PluginFoundationService;\n auth: () => AuthContext;\n}\n\nexport interface UmojaPluginHost {\n context: UmojaPluginContext;\n install(app: App): void | Promise<void>;\n installPlugin: (\n app: App,\n descriptor: UmojaFrontendPluginDescriptor,\n options?: PluginInstallOptions,\n ) => Promise<void>;\n}\n\nexport interface RequestOptions extends Omit<RequestInit, \"body\"> {\n query?: Record<string, string | number | boolean | null | undefined>;\n body?: unknown;\n raw?: boolean;\n serializeBody?: boolean;\n responseType?: \"json\" | \"blob\" | \"text\" | \"response\";\n}\n\nexport interface UmojaApiClient {\n request<T>(path: string, options?: RequestOptions): Promise<T>;\n get<T>(path: string, query?: RequestOptions[\"query\"]): Promise<T>;\n post<T>(path: string, body?: unknown): Promise<T>;\n put<T>(path: string, body?: unknown): Promise<T>;\n patch<T>(path: string, body?: unknown): Promise<T>;\n delete<T>(path: string): Promise<T>;\n}\n\nexport interface PluginFoundationService {\n catalog(): Promise<PluginCatalogRecord[]>;\n installed(): Promise<CompanyPlugin[]>;\n frontend(): Promise<FrontendDiscoveryResponse>;\n configuration(pluginId: string): Promise<JsonObject>;\n updateConfiguration(\n pluginId: string,\n payload: JsonObject,\n ): Promise<JsonObject>;\n subscription(pluginId: string): Promise<JsonObject>;\n install(pluginId: string, version?: string | null): Promise<CompanyPlugin>;\n activate(pluginId: string): Promise<CompanyPlugin>;\n deactivate(pluginId: string): Promise<CompanyPlugin>;\n suspend(pluginId: string, reason: string): Promise<CompanyPlugin>;\n resume(pluginId: string): Promise<CompanyPlugin>;\n upgrade(pluginId: string, version: string): Promise<CompanyPlugin>;\n uninstall(pluginId: string): Promise<JsonObject>;\n updateSubscription(\n pluginId: string,\n payload?: PluginSubscriptionRequest,\n ): Promise<JsonObject>;\n contracts(): Promise<JsonObject>;\n}\n\nexport interface UmojaPluginRegistry {\n register(descriptor: UmojaFrontendPluginDescriptor): void;\n get(pluginId: string): UmojaFrontendPluginDescriptor | undefined;\n all(): UmojaFrontendPluginDescriptor[];\n navigation(): NavigationContribution[];\n setBackendState(plugins: CompanyPlugin[]): void;\n access(pluginId: string, permission?: string): PluginAccessState;\n}\n\nexport const UMOJA_PLUGIN_CONTEXT: InjectionKey<UmojaPluginContext> = Symbol(\n \"umoja-plugin-context\",\n);\n\nexport class UmojaApiError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly details?: unknown,\n ) {\n super(message);\n this.name = \"UmojaApiError\";\n }\n}\n","import type {\n ApiEnvelope,\n RequestOptions,\n UmojaApiClient,\n UmojaPluginHostOptions,\n} from \"./types\";\nimport { UmojaApiError } from \"./types\";\n\nexport function createApiClient(\n options: UmojaPluginHostOptions,\n): UmojaApiClient {\n const fetcher = options.fetch ?? globalThis.fetch.bind(globalThis);\n const baseUrl = (options.apiBaseUrl ?? \"\").replace(/\\/$/, \"\");\n\n async function request<T>(\n path: string,\n requestOptions: RequestOptions = {},\n ): Promise<T> {\n const auth = options.getAuth();\n const url = new URL(\n `${baseUrl}${path}`,\n baseUrl || globalThis.location?.origin || \"http://localhost\",\n );\n for (const [key, value] of Object.entries(requestOptions.query ?? {})) {\n if (value !== null && value !== undefined && value !== \"\")\n url.searchParams.set(key, String(value));\n }\n const headers = new Headers(requestOptions.headers);\n const serializeBody = requestOptions.serializeBody ?? true;\n if (\n !headers.has(\"Content-Type\") &&\n requestOptions.body !== undefined &&\n serializeBody\n )\n headers.set(\"Content-Type\", \"application/json\");\n if (auth.token) headers.set(\"Authorization\", `Bearer ${auth.token}`);\n if (auth.companyId) headers.set(\"X-Company-Id\", auth.companyId);\n\n const response = await fetcher(url, {\n ...requestOptions,\n headers,\n credentials: requestOptions.credentials ?? \"include\",\n body:\n requestOptions.body === undefined\n ? undefined\n : serializeBody\n ? JSON.stringify(requestOptions.body)\n : (requestOptions.body as BodyInit),\n });\n if (response.ok && requestOptions.responseType === \"response\")\n return response as T;\n if (response.ok && requestOptions.responseType === \"blob\")\n return (await response.blob()) as T;\n if (response.ok && requestOptions.responseType === \"text\")\n return (await response.text()) as T;\n const payload =\n response.status === 204 ? null : await response.json().catch(() => null);\n if (!response.ok || (payload && payload.success === false)) {\n const message =\n payload?.error ??\n payload?.message ??\n `Request failed with status ${response.status}`;\n const error = new UmojaApiError(message, response.status, payload);\n if (response.status === 401) options.onUnauthorized?.();\n if (response.status === 403 && /subscription/i.test(message))\n options.onSubscriptionRequired?.();\n options.onError?.(error);\n throw error;\n }\n if (requestOptions.raw) return payload as T;\n return (isEnvelope<T>(payload) ? payload.data : payload) as T;\n }\n\n return {\n request,\n get: (path, query) => request(path, { method: \"GET\", query }),\n post: (path, body) => request(path, { method: \"POST\", body }),\n put: (path, body) => request(path, { method: \"PUT\", body }),\n patch: (path, body) => request(path, { method: \"PATCH\", body }),\n delete: (path) => request(path, { method: \"DELETE\" }),\n };\n}\n\nfunction isEnvelope<T>(payload: unknown): payload is ApiEnvelope<T> {\n return Boolean(\n payload &&\n typeof payload === \"object\" &&\n \"success\" in payload &&\n \"data\" in payload,\n );\n}\n","import type {\n CompanyPlugin,\n JsonObject,\n NormalizedPluginCatalogItem,\n PluginCatalogRecord,\n PluginManifest,\n} from \"./types\";\n\nconst PLUGIN_ICONS: Readonly<Record<string, string>> = Object.freeze({\n sms: \"pi pi-mobile\",\n \"custom-emails\": \"pi pi-envelope\",\n \"ai-assistant\": \"pi pi-sparkles\",\n \"google-drive\": \"pi pi-cloud\",\n \"workflows-automation\": \"pi pi-sitemap\",\n});\n\nexport function pluginIcon(\n pluginId: string,\n manifest?: Partial<PluginManifest>,\n): string {\n const navigationIcon = manifest?.frontend?.navigation?.find(\n (item) => item.icon,\n )?.icon;\n return navigationIcon || PLUGIN_ICONS[pluginId] || \"pi pi-puzzle-piece\";\n}\n\nexport function pluginPricingLabel(\n pricing: JsonObject = {},\n formatPrice: (\n amount: unknown,\n currency: unknown,\n ) => string = defaultPriceFormatter,\n): string {\n switch (pricing.type) {\n case \"fixed\":\n return `${formatPrice(pricing.amount, pricing.currency)}${billingCycleSuffix(pricing.billing_cycle)}`;\n case \"usage_based\":\n return `${formatPrice(pricing.unit_amount, pricing.currency)} per ${humanize(pricing.unit)}${usageBillingSuffix(pricing.billing_cycle)}`;\n case \"hybrid\":\n return `${formatPrice(pricing.base_amount, pricing.currency)}${billingCycleSuffix(pricing.billing_cycle)} + usage`;\n default:\n return \"Free\";\n }\n}\n\nfunction billingCycleSuffix(value: unknown): string {\n return value ? ` / ${humanize(value)}` : \"\";\n}\n\nfunction usageBillingSuffix(value: unknown): string {\n return value ? `, billed ${humanize(value)}` : \"\";\n}\n\nexport function normalizePluginCatalog(\n catalog: PluginCatalogRecord[] = [],\n installed: CompanyPlugin[] = [],\n formatPrice?: (amount: unknown, currency: unknown) => string,\n): NormalizedPluginCatalogItem[] {\n const installedById = new Map(\n installed.map((item) => [item.plugin_id, item]),\n );\n const catalogIds = new Set(catalog.map((item) => item.plugin_id));\n const entries = [\n ...catalog,\n ...installed\n .filter((item) => !catalogIds.has(item.plugin_id))\n .map((item): PluginCatalogRecord => ({\n plugin_id: item.plugin_id,\n version: item.version,\n name: item.manifest.name,\n description: item.manifest.description,\n manifest: item.manifest,\n is_current: true,\n is_available: false,\n created_at: \"\",\n })),\n ];\n\n return entries.map((entry) => {\n const installation = installedById.get(entry.plugin_id) ?? null;\n const manifest = installation?.manifest ?? entry.manifest;\n const subscriptionStatus = installation?.subscription_status ?? null;\n const lifecycleStatus = installation?.status ?? \"available\";\n const subscribed = Boolean(subscriptionStatus);\n const entitled = subscriptionStatus === \"active\";\n return {\n id: entry.plugin_id,\n version: installation?.version ?? entry.version,\n name: entry.name || manifest.name || humanize(entry.plugin_id),\n description:\n entry.description ||\n manifest.description ||\n \"Extend Umoja with an optional capability.\",\n icon: pluginIcon(entry.plugin_id, manifest),\n pricing: manifest.pricing ?? { type: \"free\" },\n priceLabel: pluginPricingLabel(manifest.pricing, formatPrice),\n capabilities: Array.isArray(manifest.capabilities)\n ? manifest.capabilities\n : [],\n installation,\n lifecycleStatus,\n subscriptionStatus,\n subscribed,\n entitled,\n active: lifecycleStatus === \"active\" && entitled,\n setupRequired: entitled && lifecycleStatus !== \"active\",\n };\n });\n}\n\nexport function pluginActionLabel(plugin: NormalizedPluginCatalogItem): string {\n if (plugin.active) return \"Subscribed\";\n if (plugin.subscriptionStatus === \"pending_payment\") return \"Payment pending\";\n if (plugin.setupRequired) return \"Setup required\";\n if (plugin.subscribed) return \"Resume subscription\";\n return \"Subscribe\";\n}\n\nfunction humanize(value: unknown): string {\n return String(value || \"\")\n .replaceAll(\"_\", \" \")\n .replaceAll(\"-\", \" \")\n .replace(/\\b\\w/g, (character) => character.toUpperCase());\n}\n\nfunction defaultPriceFormatter(amount: unknown, currency: unknown): string {\n return `${String(currency || \"\")} ${String(amount || 0)}`.trim();\n}\n","import { computed, inject, ref, type Ref } from \"vue\";\nimport { UMOJA_PLUGIN_CONTEXT } from \"./types\";\n\nexport function useUmojaPluginContext() {\n const context = inject(UMOJA_PLUGIN_CONTEXT);\n if (!context) throw new Error(\"Umoja plugin host is not installed\");\n return context;\n}\n\n/** Concise alias for host-shell components. */\nexport const usePluginContext = useUmojaPluginContext;\n\nexport function usePluginApi() {\n return useUmojaPluginContext().api;\n}\n\nexport function usePluginAccess(pluginId: string, permission?: string) {\n const context = useUmojaPluginContext();\n const access = computed(() => context.registry.access(pluginId, permission));\n return {\n access,\n allowed: computed(() => access.value.allowed),\n reason: computed(() => access.value.reason),\n };\n}\n\nexport function usePluginConfiguration(pluginId: string) {\n const { foundation } = useUmojaPluginContext();\n return {\n load: () => foundation.configuration(pluginId),\n save: (\n configuration: Record<string, unknown>,\n secrets?: Record<string, unknown>,\n ) => foundation.updateConfiguration(pluginId, { configuration, secrets }),\n };\n}\n\nexport function useAsyncResource<T>(loader: () => Promise<T>) {\n const data = ref<T | null>(null) as Ref<T | null>;\n const loading = ref(false);\n const error = ref<Error | null>(null);\n async function load() {\n loading.value = true;\n error.value = null;\n try {\n data.value = await loader();\n return data.value;\n } catch (cause) {\n error.value = cause instanceof Error ? cause : new Error(String(cause));\n throw error.value;\n } finally {\n loading.value = false;\n }\n }\n return { data, loading, error, load };\n}\n","import type {\n CompanyPlugin,\n FrontendDiscoveryResponse,\n JsonObject,\n PluginCatalogRecord,\n PluginFoundationService,\n PluginSubscriptionRequest,\n UmojaApiClient,\n} from \"./types\";\n\nexport class DefaultPluginFoundationService implements PluginFoundationService {\n constructor(private readonly api: UmojaApiClient) {}\n\n catalog(): Promise<PluginCatalogRecord[]> {\n return this.api.get(\"/api/plugins/catalog\");\n }\n\n installed(): Promise<CompanyPlugin[]> {\n return this.api.get(\"/api/plugins\");\n }\n\n frontend(): Promise<FrontendDiscoveryResponse> {\n return this.api.get(\"/api/plugins/frontend\");\n }\n\n configuration(pluginId: string): Promise<JsonObject> {\n return this.api.get(\n `/api/plugins/${encodeURIComponent(pluginId)}/configuration`,\n );\n }\n\n updateConfiguration(\n pluginId: string,\n payload: JsonObject,\n ): Promise<JsonObject> {\n return this.api.put(\n `/api/plugins/${encodeURIComponent(pluginId)}/configuration`,\n payload,\n );\n }\n\n subscription(pluginId: string): Promise<JsonObject> {\n return this.api.get(\n `/api/plugins/${encodeURIComponent(pluginId)}/subscription`,\n );\n }\n\n install(pluginId: string, version?: string | null): Promise<CompanyPlugin> {\n return this.api.post(\n `/api/plugins/${encodeURIComponent(pluginId)}/install`,\n {\n version: version ?? null,\n },\n );\n }\n\n activate(pluginId: string): Promise<CompanyPlugin> {\n return this.api.post(\n `/api/plugins/${encodeURIComponent(pluginId)}/activate`,\n );\n }\n\n deactivate(pluginId: string): Promise<CompanyPlugin> {\n return this.api.post(\n `/api/plugins/${encodeURIComponent(pluginId)}/deactivate`,\n );\n }\n\n suspend(pluginId: string, reason: string): Promise<CompanyPlugin> {\n return this.api.post(\n `/api/plugins/${encodeURIComponent(pluginId)}/suspend`,\n {\n reason,\n },\n );\n }\n\n resume(pluginId: string): Promise<CompanyPlugin> {\n return this.api.post(`/api/plugins/${encodeURIComponent(pluginId)}/resume`);\n }\n\n upgrade(pluginId: string, version: string): Promise<CompanyPlugin> {\n return this.api.post(\n `/api/plugins/${encodeURIComponent(pluginId)}/upgrade`,\n {\n version,\n },\n );\n }\n\n uninstall(pluginId: string): Promise<JsonObject> {\n return this.api.delete(`/api/plugins/${encodeURIComponent(pluginId)}`);\n }\n\n updateSubscription(\n pluginId: string,\n payload: PluginSubscriptionRequest = {},\n ): Promise<JsonObject> {\n return this.api.put(\n `/api/plugins/${encodeURIComponent(pluginId)}/subscription`,\n {\n usage_limit: null,\n period_ends_at: null,\n core_subscription_id: null,\n metadata: {},\n ...payload,\n },\n );\n }\n\n contracts(): Promise<JsonObject> {\n return this.api.get(\"/api/plugins/contracts\");\n }\n}\n","import type {\n AuthContext,\n CompanyPlugin,\n NavigationContribution,\n PluginAccessState,\n UmojaFrontendPluginDescriptor,\n UmojaPluginRegistry,\n} from \"./types\";\n\nexport class DefaultPluginRegistry implements UmojaPluginRegistry {\n private readonly descriptors = new Map<\n string,\n UmojaFrontendPluginDescriptor\n >();\n private readonly backend = new Map<string, CompanyPlugin>();\n\n constructor(private readonly auth: () => AuthContext) {}\n\n register(descriptor: UmojaFrontendPluginDescriptor): void {\n if (this.descriptors.has(descriptor.id)) return;\n this.descriptors.set(descriptor.id, descriptor);\n }\n\n get(pluginId: string): UmojaFrontendPluginDescriptor | undefined {\n return this.descriptors.get(pluginId);\n }\n\n all(): UmojaFrontendPluginDescriptor[] {\n return [...this.descriptors.values()];\n }\n\n navigation(): NavigationContribution[] {\n return this.all()\n .filter((plugin) => this.access(plugin.id).allowed)\n .flatMap((plugin) =>\n plugin.navigation.filter((item) =>\n this.hasPermission(item.required_permission),\n ),\n )\n .sort((left, right) => left.order - right.order);\n }\n\n setBackendState(plugins: CompanyPlugin[]): void {\n this.backend.clear();\n plugins.forEach((plugin) => this.backend.set(plugin.plugin_id, plugin));\n }\n\n access(pluginId: string, permission?: string): PluginAccessState {\n const plugin = this.backend.get(pluginId);\n const installed = Boolean(plugin && plugin.status !== \"uninstalled\");\n const active = plugin?.status === \"active\";\n const entitled =\n plugin?.subscription_status === \"active\" &&\n !isExpired(plugin?.period_ends_at);\n const permitted = !permission || this.hasPermission(permission);\n const allowed = installed && active && entitled && permitted;\n return {\n installed,\n active,\n entitled,\n allowed,\n reason: allowed\n ? undefined\n : !installed\n ? \"Plugin is not installed\"\n : !active\n ? \"Plugin is not active\"\n : !entitled\n ? \"Plugin subscription is not entitled\"\n : \"Permission is required\",\n };\n }\n\n private hasPermission(permission: string): boolean {\n const auth = this.auth();\n return Boolean(auth.isSuperAdmin || auth.permissions.includes(permission));\n }\n}\n\nfunction isExpired(value?: string | null): boolean {\n return Boolean(value && new Date(value).getTime() <= Date.now());\n}\n","import type { App } from \"vue\";\nimport { createApiClient } from \"./api\";\nimport { DefaultPluginFoundationService } from \"./foundation\";\nimport { DefaultPluginRegistry } from \"./registry\";\nimport {\n UMOJA_PLUGIN_CONTEXT,\n type PluginInstallOptions,\n type UmojaFrontendPluginDescriptor,\n type UmojaPluginHost,\n type UmojaPluginHostOptions,\n} from \"./types\";\n\nexport function createUmojaPluginHost(\n options: UmojaPluginHostOptions,\n): UmojaPluginHost {\n const api = createApiClient(options);\n const registry = new DefaultPluginRegistry(options.getAuth);\n const foundation = new DefaultPluginFoundationService(api);\n const context = { api, registry, foundation, auth: options.getAuth };\n\n async function installPlugin(\n app: App,\n descriptor: UmojaFrontendPluginDescriptor,\n installOptions: PluginInstallOptions = {},\n ): Promise<void> {\n registry.register(descriptor);\n for (const [name, component] of Object.entries(\n descriptor.components ?? {},\n )) {\n app.component(name, component);\n }\n const router = options.router;\n if (router) {\n for (const route of descriptor.routes) {\n if (router.hasRoute(String(route.name))) continue;\n if (installOptions.routeParentName)\n router.addRoute(installOptions.routeParentName, route);\n else router.addRoute(route);\n }\n }\n await descriptor.initialize?.(context);\n }\n\n const host: UmojaPluginHost = {\n context,\n async install(app: App) {\n app.provide(UMOJA_PLUGIN_CONTEXT, context);\n app.config.globalProperties.$umojaPlugins = context;\n app.config.globalProperties.$umojaPluginsHost = host;\n try {\n registry.setBackendState(await foundation.installed());\n } catch {\n registry.setBackendState([]);\n }\n },\n installPlugin,\n };\n return host;\n}\n\nexport function defineUmojaPlugin(descriptor: UmojaFrontendPluginDescriptor) {\n return {\n descriptor,\n async install(app: App, options: PluginInstallOptions = {}) {\n const host =\n options.host ??\n (app.config.globalProperties.$umojaPluginsHost as\n UmojaPluginHost | undefined);\n if (!host) {\n throw new Error(\n `Install the Umoja plugin host before ${descriptor.name}, or pass { host } to app.use().`,\n );\n }\n await host.installPlugin(app, descriptor, options);\n },\n };\n}\n\ndeclare module \"@vue/runtime-core\" {\n interface ComponentCustomProperties {\n $umojaPlugins: ReturnType<typeof createUmojaPluginHost>[\"context\"];\n $umojaPluginsHost?: UmojaPluginHost;\n }\n}\n","<script setup lang=\"ts\">\ndefineProps<{ title?: string; message?: string; icon?: string }>();\n</script>\n\n<template>\n <div class=\"umoja-card umoja-empty-state\">\n <i :class=\"[icon ?? 'pi pi-inbox', 'umoja-empty-state__icon']\" />\n <strong>{{ title ?? \"No records found\" }}</strong>\n <p>{{ message ?? \"There is nothing to show yet.\" }}</p>\n <slot name=\"actions\" />\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport ProgressSpinner from \"primevue/progressspinner\";\ndefineProps<{ label?: string }>();\n</script>\n\n<template>\n <div class=\"umoja-card umoja-state\">\n <ProgressSpinner\n style=\"width: 2rem; height: 2rem\"\n stroke-width=\"4\"\n /><span>{{ label ?? \"Loading\" }}</span>\n </div>\n</template>\n","<script setup lang=\"ts\">\ndefineProps<{\n label: string;\n value: string | number;\n icon: string;\n hint?: string;\n}>();\n</script>\n\n<template>\n <article class=\"umoja-card umoja-metric-card\">\n <span class=\"umoja-icon\"><i :class=\"icon\" /></span>\n <div>\n <span>{{ label }}</span><strong>{{ value }}</strong\n ><small v-if=\"hint\">{{ hint }}</small>\n </div>\n </article>\n</template>\n","<script setup lang=\"ts\">\ndefineProps<{ title: string; subtitle?: string }>();\n</script>\n\n<template>\n <div class=\"umoja-page-header\">\n <div>\n <h1>{{ title }}</h1>\n <p v-if=\"subtitle\">{{ subtitle }}</p>\n </div>\n <div v-if=\"$slots.actions\" class=\"umoja-page-header__actions\">\n <slot name=\"actions\" />\n </div>\n </div>\n</template>\n"],"names":["UMOJA_PLUGIN_CONTEXT","UmojaApiError","message","status","details","createApiClient","options","fetcher","baseUrl","request","path","requestOptions","auth","url","_a","key","value","headers","serializeBody","response","payload","error","_b","_c","_d","isEnvelope","query","body","PLUGIN_ICONS","pluginIcon","pluginId","manifest","item","pluginPricingLabel","pricing","formatPrice","defaultPriceFormatter","billingCycleSuffix","humanize","usageBillingSuffix","normalizePluginCatalog","catalog","installed","installedById","catalogIds","entry","installation","subscriptionStatus","lifecycleStatus","subscribed","entitled","pluginActionLabel","plugin","character","amount","currency","useUmojaPluginContext","context","inject","usePluginContext","usePluginApi","usePluginAccess","permission","access","computed","usePluginConfiguration","foundation","configuration","secrets","useAsyncResource","loader","data","ref","loading","load","cause","DefaultPluginFoundationService","api","version","reason","DefaultPluginRegistry","__publicField","descriptor","left","right","plugins","active","isExpired","permitted","allowed","createUmojaPluginHost","registry","installPlugin","app","installOptions","name","component","router","route","host","defineUmojaPlugin","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","__props","_renderSlot","_ctx","_createVNode","_unref","ProgressSpinner","_hoisted_2","$slots","_hoisted_3"],"mappings":";;;;;AAwOO,MAAMA,IAAy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MACbN,EAAqC,gBAA5BC,EAAA,SAAK,SAAA,GAAA,CAAA;AAAA,IAAA;;;;;;;;;;;sBCAlBJ,EAAA,GAAAC,EAMU,WANVC,GAMU;AAAA,MALRC,EAAmD,QAAnDO,GAAmD;AAAA,QAA1BP,EAAmB,KAAA;AAAA,UAAf,SAAOC,EAAA,IAAI;AAAA,QAAA;;MACxCD,EAGM,OAAA,MAAA;AAAA,QAFJA,EAAwB,gBAAfC,EAAA,KAAK,GAAA,CAAA;AAAA,QAAUD,EACvB,kBADkCC,EAAA,KAAK,GAAA,CAAA;AAAA,QAC1BA,EAAA,QAAbJ,EAAA,GAAAC,EAAqC,eAAfG,EAAA,IAAI,GAAA,CAAA;;;;;;;;;;;;;;sBCT/BJ,EAAA,GAAAC,EAQM,OARNC,IAQM;AAAA,MAPJC,EAGM,OAAA,MAAA;AAAA,QAFJA,EAAoB,cAAbC,EAAA,KAAK,GAAA,CAAA;AAAA,QACHA,EAAA,YAATJ,EAAA,GAAAC,EAAqC,WAAfG,EAAA,QAAQ,GAAA,CAAA;;MAErBO,EAAAA,OAAO,WAAlBX,KAAAC,EAEM,OAFNW,IAEM;AAAA,QADJP,EAAuBC,EAAA,QAAA,SAAA;AAAA,MAAA;;;;"}
@@ -0,0 +1,15 @@
1
+ import { AuthContext, CompanyPlugin, NavigationContribution, PluginAccessState, UmojaFrontendPluginDescriptor, UmojaPluginRegistry } from './types';
2
+ export declare class DefaultPluginRegistry implements UmojaPluginRegistry {
3
+ private readonly auth;
4
+ private readonly descriptors;
5
+ private readonly backend;
6
+ constructor(auth: () => AuthContext);
7
+ register(descriptor: UmojaFrontendPluginDescriptor): void;
8
+ get(pluginId: string): UmojaFrontendPluginDescriptor | undefined;
9
+ all(): UmojaFrontendPluginDescriptor[];
10
+ navigation(): NavigationContribution[];
11
+ setBackendState(plugins: CompanyPlugin[]): void;
12
+ access(pluginId: string, permission?: string): PluginAccessState;
13
+ private hasPermission;
14
+ }
15
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,sBAAsB,EACtB,iBAAiB,EACjB,6BAA6B,EAC7B,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,qBAAa,qBAAsB,YAAW,mBAAmB;IAOnD,OAAO,CAAC,QAAQ,CAAC,IAAI;IANjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAGxB;IACJ,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;gBAE/B,IAAI,EAAE,MAAM,WAAW;IAEpD,QAAQ,CAAC,UAAU,EAAE,6BAA6B,GAAG,IAAI;IAKzD,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,6BAA6B,GAAG,SAAS;IAIhE,GAAG,IAAI,6BAA6B,EAAE;IAItC,UAAU,IAAI,sBAAsB,EAAE;IAWtC,eAAe,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,IAAI;IAK/C,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,iBAAiB;IA0BhE,OAAO,CAAC,aAAa;CAItB"}
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ :root{--umoja-radius: 8px;--umoja-page-gap: 1.5rem}.umoja-plugin-page{display:grid;gap:var(--umoja-page-gap);color:var(--text-color, var(--p-text-color))}.umoja-page-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.25rem}.umoja-page-header h1{margin:0;color:var(--p-surface-900);font-size:1.875rem;font-weight:600}.app-dark .umoja-page-header h1{color:var(--p-surface-0)}.umoja-page-header p{margin:.5rem 0 0;color:var(--text-color-secondary, var(--p-text-muted-color))}.umoja-page-header__actions{display:flex;align-items:center;gap:.5rem}.umoja-card{border:1px solid var(--surface-border, var(--p-content-border-color));border-radius:var(--umoja-radius);background:var(--surface-card, var(--p-content-background));padding:1.5rem}.umoja-card-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem}.umoja-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.umoja-field{display:grid;gap:.45rem}.umoja-field label{font-weight:600}.umoja-field--full{grid-column:1 / -1}.umoja-actions{display:flex;justify-content:flex-end;gap:.5rem}.umoja-state{display:flex;align-items:center;justify-content:center;gap:.75rem;min-height:9rem;color:var(--text-color-secondary)}.umoja-empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:14rem;text-align:center}.umoja-empty-state__icon{margin-bottom:1rem;color:var(--text-color-secondary);font-size:3rem}.umoja-empty-state p{max-width:36rem;color:var(--text-color-secondary)}.umoja-metric-card{display:grid;grid-template-columns:auto 1fr;gap:1rem;align-items:center}.umoja-metric-card div{display:grid;gap:.2rem}.umoja-metric-card span,.umoja-metric-card small{color:var(--text-color-secondary)}.umoja-metric-card strong{font-size:1.5rem}.umoja-icon{display:inline-flex;align-items:center;justify-content:center;width:2.75rem;height:2.75rem;border-radius:var(--umoja-radius);color:var(--p-primary-700);background:color-mix(in srgb,var(--p-primary-500) 12%,transparent)}.umoja-table-actions{display:flex;gap:.35rem;justify-content:flex-end}@media(max-width:960px){.umoja-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:640px){.umoja-page-header{align-items:flex-start;flex-direction:column}.umoja-card-grid,.umoja-form-grid{grid-template-columns:1fr}.umoja-field--full{grid-column:auto}.umoja-actions,.umoja-page-header__actions{width:100%}.umoja-actions>*,.umoja-page-header__actions>*{flex:1}}
@@ -0,0 +1,208 @@
1
+ import { App, Component, InjectionKey } from 'vue';
2
+ import { RouteRecordRaw, Router } from 'vue-router';
3
+ export type JsonObject = Record<string, unknown>;
4
+ export type PluginStatus = "installed" | "active" | "inactive" | "suspended" | "uninstalled";
5
+ export type SubscriptionStatus = "active" | "pending_payment" | "expired" | "cancelled" | null;
6
+ export interface ApiEnvelope<T> {
7
+ success: boolean;
8
+ data: T;
9
+ error?: string;
10
+ }
11
+ export interface PaginatedResponse<T> {
12
+ success?: boolean;
13
+ data: T[];
14
+ page: number;
15
+ per_page: number;
16
+ total: number;
17
+ total_pages: number;
18
+ }
19
+ export interface PluginCapability {
20
+ key: string;
21
+ name: string;
22
+ description: string;
23
+ input_schema: JsonObject;
24
+ output_schema: JsonObject;
25
+ }
26
+ export interface NavigationContribution {
27
+ key: string;
28
+ label: string;
29
+ path: string;
30
+ icon?: string | null;
31
+ required_permission: string;
32
+ order: number;
33
+ }
34
+ export interface PluginManifest {
35
+ contract_version: string;
36
+ id: string;
37
+ name: string;
38
+ version: string;
39
+ description: string;
40
+ capabilities: PluginCapability[];
41
+ permissions: Array<{
42
+ name: string;
43
+ description: string;
44
+ }>;
45
+ configuration_schema: JsonObject;
46
+ frontend: {
47
+ navigation: NavigationContribution[];
48
+ contextual_actions: JsonObject[];
49
+ configuration_ui?: {
50
+ kind: string;
51
+ entrypoint?: string | null;
52
+ } | null;
53
+ };
54
+ pricing: JsonObject;
55
+ }
56
+ export interface CompanyPlugin {
57
+ id: string;
58
+ company_id: string;
59
+ plugin_id: string;
60
+ version: string;
61
+ status: PluginStatus;
62
+ manifest: PluginManifest;
63
+ subscription_status: SubscriptionStatus;
64
+ period_ends_at?: string | null;
65
+ is_configured: boolean;
66
+ }
67
+ export interface PluginCatalogRecord {
68
+ plugin_id: string;
69
+ version: string;
70
+ name: string;
71
+ description: string;
72
+ manifest: PluginManifest;
73
+ is_current: boolean;
74
+ is_available: boolean;
75
+ created_at: string;
76
+ }
77
+ export interface PluginSubscriptionRequest {
78
+ usage_limit?: number | null;
79
+ period_ends_at?: string | null;
80
+ core_subscription_id?: string | null;
81
+ metadata?: JsonObject;
82
+ }
83
+ export interface NormalizedPluginCatalogItem {
84
+ id: string;
85
+ version: string;
86
+ name: string;
87
+ description: string;
88
+ icon: string;
89
+ pricing: JsonObject;
90
+ priceLabel: string;
91
+ capabilities: PluginCapability[];
92
+ installation: CompanyPlugin | null;
93
+ lifecycleStatus: string;
94
+ subscriptionStatus: SubscriptionStatus;
95
+ subscribed: boolean;
96
+ entitled: boolean;
97
+ active: boolean;
98
+ setupRequired: boolean;
99
+ }
100
+ export interface FrontendPlugin {
101
+ plugin_id: string;
102
+ name: string;
103
+ version: string;
104
+ navigation: NavigationContribution[];
105
+ contextual_actions: JsonObject[];
106
+ configuration_ui?: JsonObject | null;
107
+ }
108
+ export interface FrontendDiscoveryResponse {
109
+ plugins: FrontendPlugin[];
110
+ }
111
+ export interface AuthContext {
112
+ token: string | null;
113
+ userId?: string | null;
114
+ companyId: string | null;
115
+ permissions: string[];
116
+ isSuperAdmin?: boolean;
117
+ }
118
+ export interface PluginRoute extends Omit<RouteRecordRaw, "children"> {
119
+ children?: PluginRoute[];
120
+ }
121
+ export interface UmojaFrontendPluginDescriptor {
122
+ id: string;
123
+ name: string;
124
+ version: string;
125
+ routes: RouteRecordRaw[];
126
+ navigation: NavigationContribution[];
127
+ components?: Record<string, Component>;
128
+ capabilities?: string[];
129
+ initialize?: (context: UmojaPluginContext) => void | Promise<void>;
130
+ }
131
+ export interface PluginAccessState {
132
+ installed: boolean;
133
+ active: boolean;
134
+ entitled: boolean;
135
+ allowed: boolean;
136
+ reason?: string;
137
+ }
138
+ export interface UmojaPluginHostOptions {
139
+ apiBaseUrl?: string;
140
+ router?: Router;
141
+ getAuth: () => AuthContext;
142
+ fetch?: typeof globalThis.fetch;
143
+ onUnauthorized?: () => void;
144
+ onSubscriptionRequired?: () => void;
145
+ onError?: (error: UmojaApiError) => void;
146
+ }
147
+ export interface PluginInstallOptions {
148
+ host?: UmojaPluginHost;
149
+ routeParentName?: string;
150
+ }
151
+ export interface UmojaPluginContext {
152
+ api: UmojaApiClient;
153
+ registry: UmojaPluginRegistry;
154
+ foundation: PluginFoundationService;
155
+ auth: () => AuthContext;
156
+ }
157
+ export interface UmojaPluginHost {
158
+ context: UmojaPluginContext;
159
+ install(app: App): void | Promise<void>;
160
+ installPlugin: (app: App, descriptor: UmojaFrontendPluginDescriptor, options?: PluginInstallOptions) => Promise<void>;
161
+ }
162
+ export interface RequestOptions extends Omit<RequestInit, "body"> {
163
+ query?: Record<string, string | number | boolean | null | undefined>;
164
+ body?: unknown;
165
+ raw?: boolean;
166
+ serializeBody?: boolean;
167
+ responseType?: "json" | "blob" | "text" | "response";
168
+ }
169
+ export interface UmojaApiClient {
170
+ request<T>(path: string, options?: RequestOptions): Promise<T>;
171
+ get<T>(path: string, query?: RequestOptions["query"]): Promise<T>;
172
+ post<T>(path: string, body?: unknown): Promise<T>;
173
+ put<T>(path: string, body?: unknown): Promise<T>;
174
+ patch<T>(path: string, body?: unknown): Promise<T>;
175
+ delete<T>(path: string): Promise<T>;
176
+ }
177
+ export interface PluginFoundationService {
178
+ catalog(): Promise<PluginCatalogRecord[]>;
179
+ installed(): Promise<CompanyPlugin[]>;
180
+ frontend(): Promise<FrontendDiscoveryResponse>;
181
+ configuration(pluginId: string): Promise<JsonObject>;
182
+ updateConfiguration(pluginId: string, payload: JsonObject): Promise<JsonObject>;
183
+ subscription(pluginId: string): Promise<JsonObject>;
184
+ install(pluginId: string, version?: string | null): Promise<CompanyPlugin>;
185
+ activate(pluginId: string): Promise<CompanyPlugin>;
186
+ deactivate(pluginId: string): Promise<CompanyPlugin>;
187
+ suspend(pluginId: string, reason: string): Promise<CompanyPlugin>;
188
+ resume(pluginId: string): Promise<CompanyPlugin>;
189
+ upgrade(pluginId: string, version: string): Promise<CompanyPlugin>;
190
+ uninstall(pluginId: string): Promise<JsonObject>;
191
+ updateSubscription(pluginId: string, payload?: PluginSubscriptionRequest): Promise<JsonObject>;
192
+ contracts(): Promise<JsonObject>;
193
+ }
194
+ export interface UmojaPluginRegistry {
195
+ register(descriptor: UmojaFrontendPluginDescriptor): void;
196
+ get(pluginId: string): UmojaFrontendPluginDescriptor | undefined;
197
+ all(): UmojaFrontendPluginDescriptor[];
198
+ navigation(): NavigationContribution[];
199
+ setBackendState(plugins: CompanyPlugin[]): void;
200
+ access(pluginId: string, permission?: string): PluginAccessState;
201
+ }
202
+ export declare const UMOJA_PLUGIN_CONTEXT: InjectionKey<UmojaPluginContext>;
203
+ export declare class UmojaApiError extends Error {
204
+ readonly status: number;
205
+ readonly details?: unknown | undefined;
206
+ constructor(message: string, status: number, details?: unknown | undefined);
207
+ }
208
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACjD,MAAM,MAAM,YAAY,GACtB,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,CAAC;AACpE,MAAM,MAAM,kBAAkB,GAC5B,QAAQ,GAAG,iBAAiB,GAAG,SAAS,GAAG,WAAW,GAAG,IAAI,CAAC;AAEhE,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,UAAU,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5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Vue 3 integration SDK for Umoja Business Platform plugins",
5
+ "type": "module",
6
+ "sideEffects": [
7
+ "./dist/style.css"
8
+ ],
9
+ "files": [
10
+ "dist",
11
+ "README.md"
12
+ ],
13
+ "main": "./dist/index.js",
14
+ "module": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js"
20
+ },
21
+ "./style.css": "./dist/style.css"
22
+ },
23
+ "scripts": {
24
+ "build": "vite build",
25
+ "typecheck": "vue-tsc --noEmit"
26
+ },
27
+ "peerDependencies": {
28
+ "primevue": "^4.5.0",
29
+ "vue": "^3.4.0",
30
+ "vue-router": "^4.4.0"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ }
35
+ }