@nuwah/vertical-sdk 0.0.0-stage → 0.2.0-rc.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/LICENSE +17 -0
- package/README.md +229 -2
- package/bin/nuwah-contract-check-rules.d.mts +41 -0
- package/bin/nuwah-contract-check-rules.mjs +333 -0
- package/bin/nuwah-contract-check.mjs +64 -0
- package/dist/accounting.d.ts +1417 -0
- package/dist/accounting.js +274 -0
- package/dist/active-org.d.ts +13 -0
- package/dist/active-org.js +59 -0
- package/dist/actors.d.ts +448 -0
- package/dist/actors.js +143 -0
- package/dist/ai.d.ts +359 -0
- package/dist/ai.js +229 -0
- package/dist/analytics.d.ts +37 -0
- package/dist/analytics.js +8 -0
- package/dist/atlas.d.ts +291 -0
- package/dist/atlas.js +78 -0
- package/dist/audit.d.ts +193 -0
- package/dist/audit.js +26 -0
- package/dist/authentication.d.ts +119 -0
- package/dist/authentication.js +83 -0
- package/dist/awards.d.ts +38 -0
- package/dist/awards.js +10 -0
- package/dist/blueprint/document.d.ts +178 -0
- package/dist/blueprint/document.js +17 -0
- package/dist/blueprint/index.d.ts +3 -0
- package/dist/blueprint/index.js +5 -0
- package/dist/blueprint/manifest.d.ts +105 -0
- package/dist/blueprint/manifest.js +11 -0
- package/dist/blueprint/validate.d.ts +14 -0
- package/dist/blueprint/validate.js +416 -0
- package/dist/bookings-directory.d.ts +118 -0
- package/dist/bookings-directory.js +289 -0
- package/dist/bookings-extra.d.ts +1448 -0
- package/dist/bookings-extra.js +582 -0
- package/dist/bookings.d.ts +1365 -0
- package/dist/bookings.js +305 -0
- package/dist/builder-code.d.ts +164 -0
- package/dist/builder-code.js +12 -0
- package/dist/builder-core-gaps.d.ts +83 -0
- package/dist/builder-core-gaps.js +8 -0
- package/dist/builder-repos.d.ts +73 -0
- package/dist/builder-repos.js +37 -0
- package/dist/builder.d.ts +730 -0
- package/dist/builder.js +105 -0
- package/dist/campaigns.d.ts +105 -0
- package/dist/campaigns.js +25 -0
- package/dist/catalogs.d.ts +188 -0
- package/dist/catalogs.js +36 -0
- package/dist/commerce-ai.d.ts +182 -0
- package/dist/commerce-ai.js +27 -0
- package/dist/connections.d.ts +278 -0
- package/dist/connections.js +96 -0
- package/dist/content-control.d.ts +121 -0
- package/dist/content-control.js +23 -0
- package/dist/contributions.d.ts +560 -0
- package/dist/contributions.js +140 -0
- package/dist/conversation-assist.d.ts +154 -0
- package/dist/conversation-assist.js +51 -0
- package/dist/conversation-info.d.ts +219 -0
- package/dist/conversation-info.js +43 -0
- package/dist/crm.d.ts +533 -0
- package/dist/crm.js +142 -0
- package/dist/dashboards.d.ts +119 -0
- package/dist/dashboards.js +22 -0
- package/dist/delegations.d.ts +161 -0
- package/dist/delegations.js +39 -0
- package/dist/docs.d.ts +289 -0
- package/dist/docs.js +49 -0
- package/dist/documents.d.ts +317 -0
- package/dist/documents.js +84 -0
- package/dist/drafts.d.ts +132 -0
- package/dist/drafts.js +56 -0
- package/dist/engagements.d.ts +133 -0
- package/dist/engagements.js +15 -0
- package/dist/event-stream.d.ts +54 -0
- package/dist/event-stream.js +228 -0
- package/dist/exchanges.d.ts +447 -0
- package/dist/exchanges.js +145 -0
- package/dist/exports.d.ts +113 -0
- package/dist/exports.js +81 -0
- package/dist/feeds.d.ts +228 -0
- package/dist/feeds.js +52 -0
- package/dist/files.d.ts +56 -0
- package/dist/files.js +55 -0
- package/dist/finance-insights.d.ts +41 -0
- package/dist/finance-insights.js +61 -0
- package/dist/fixed-assets.d.ts +155 -0
- package/dist/fixed-assets.js +28 -0
- package/dist/fulfilment-jobs.d.ts +405 -0
- package/dist/fulfilment-jobs.js +76 -0
- package/dist/fulfilment.d.ts +205 -0
- package/dist/fulfilment.js +39 -0
- package/dist/hr.d.ts +350 -0
- package/dist/hr.js +94 -0
- package/dist/http.d.ts +124 -0
- package/dist/http.js +392 -0
- package/dist/inbox.d.ts +206 -0
- package/dist/inbox.js +36 -0
- package/dist/index.d.ts +384 -0
- package/dist/index.js +294 -0
- package/dist/insights.d.ts +176 -0
- package/dist/insights.js +52 -0
- package/dist/inventory.d.ts +797 -0
- package/dist/inventory.js +120 -0
- package/dist/list-query.d.ts +211 -0
- package/dist/list-query.js +158 -0
- package/dist/listings.d.ts +381 -0
- package/dist/listings.js +173 -0
- package/dist/location-sharing.d.ts +83 -0
- package/dist/location-sharing.js +20 -0
- package/dist/marketplace.d.ts +268 -0
- package/dist/marketplace.js +59 -0
- package/dist/matching.d.ts +103 -0
- package/dist/matching.js +22 -0
- package/dist/media.d.ts +221 -0
- package/dist/media.js +239 -0
- package/dist/metrics.d.ts +125 -0
- package/dist/metrics.js +45 -0
- package/dist/moderation.d.ts +240 -0
- package/dist/moderation.js +40 -0
- package/dist/money.d.ts +41 -0
- package/dist/money.js +79 -0
- package/dist/my-data.d.ts +266 -0
- package/dist/my-data.js +32 -0
- package/dist/names.d.ts +14 -0
- package/dist/names.js +17 -0
- package/dist/occasions.d.ts +256 -0
- package/dist/occasions.js +40 -0
- package/dist/onboarding.d.ts +88 -0
- package/dist/onboarding.js +38 -0
- package/dist/pagination.d.ts +204 -0
- package/dist/pagination.js +141 -0
- package/dist/party-baseline-attributes.d.ts +245 -0
- package/dist/party-baseline-attributes.js +36 -0
- package/dist/party.d.ts +401 -0
- package/dist/party.js +56 -0
- package/dist/patient.d.ts +161 -0
- package/dist/patient.js +45 -0
- package/dist/payroll.d.ts +378 -0
- package/dist/payroll.js +60 -0
- package/dist/person-addresses.d.ts +88 -0
- package/dist/person-addresses.js +18 -0
- package/dist/person-cart.d.ts +250 -0
- package/dist/person-cart.js +63 -0
- package/dist/person-chat-assist.d.ts +47 -0
- package/dist/person-chat-assist.js +13 -0
- package/dist/person-data-webhooks.d.ts +72 -0
- package/dist/person-data-webhooks.js +86 -0
- package/dist/person-data.d.ts +212 -0
- package/dist/person-data.js +162 -0
- package/dist/person-locations.d.ts +54 -0
- package/dist/person-locations.js +6 -0
- package/dist/person-messaging.d.ts +405 -0
- package/dist/person-messaging.js +112 -0
- package/dist/person-notifications.d.ts +319 -0
- package/dist/person-notifications.js +164 -0
- package/dist/personalisation.d.ts +21 -0
- package/dist/personalisation.js +8 -0
- package/dist/platform.d.ts +63 -0
- package/dist/platform.js +45 -0
- package/dist/portfolio.d.ts +163 -0
- package/dist/portfolio.js +28 -0
- package/dist/pos.d.ts +743 -0
- package/dist/pos.js +129 -0
- package/dist/procurement.d.ts +664 -0
- package/dist/procurement.js +157 -0
- package/dist/promotions.d.ts +169 -0
- package/dist/promotions.js +39 -0
- package/dist/publications.d.ts +583 -0
- package/dist/publications.js +164 -0
- package/dist/ranking.d.ts +43 -0
- package/dist/ranking.js +34 -0
- package/dist/ratings.d.ts +293 -0
- package/dist/ratings.js +109 -0
- package/dist/reactions.d.ts +123 -0
- package/dist/reactions.js +41 -0
- package/dist/recipient-orders.d.ts +294 -0
- package/dist/recipient-orders.js +73 -0
- package/dist/relationships.d.ts +18 -0
- package/dist/relationships.js +8 -0
- package/dist/reporting.d.ts +107 -0
- package/dist/reporting.js +56 -0
- package/dist/sales.d.ts +270 -0
- package/dist/sales.js +66 -0
- package/dist/shares.d.ts +105 -0
- package/dist/shares.js +27 -0
- package/dist/shop.d.ts +993 -0
- package/dist/shop.js +215 -0
- package/dist/shopping-assistant.d.ts +65 -0
- package/dist/shopping-assistant.js +14 -0
- package/dist/spaces.d.ts +422 -0
- package/dist/spaces.js +118 -0
- package/dist/stored-value.d.ts +754 -0
- package/dist/stored-value.js +177 -0
- package/dist/types.d.ts +83 -0
- package/dist/types.js +2 -0
- package/dist/vault.d.ts +290 -0
- package/dist/vault.js +55 -0
- package/dist/vertical-runtime.d.ts +17 -0
- package/dist/vertical-runtime.js +8 -0
- package/dist/vite/build-manifest-plugin.d.ts +42 -0
- package/dist/vite/build-manifest-plugin.js +42 -0
- package/dist/vite/first-paint-plugin.d.ts +26 -0
- package/dist/vite/first-paint-plugin.js +57 -0
- package/dist/wishlists.d.ts +591 -0
- package/dist/wishlists.js +188 -0
- package/dist/workbench.d.ts +114 -0
- package/dist/workbench.js +22 -0
- package/dist/workspace.d.ts +190 -0
- package/dist/workspace.js +41 -0
- package/package.json +52 -4
- package/templates/extension-image.Dockerfile +38 -0
- package/templates/nuwah-vertical.yml +102 -0
- package/templates/vertical-app/.env.example +34 -0
- package/templates/vertical-app/README.md +108 -0
- package/templates/vertical-app/github/workflows/ci.yml +51 -0
- package/templates/vertical-app/gitignore +5 -0
- package/templates/vertical-app/index.html +12 -0
- package/templates/vertical-app/package.json +28 -0
- package/templates/vertical-app/src/App.tsx +64 -0
- package/templates/vertical-app/src/blueprint/blueprint.ts +45 -0
- package/templates/vertical-app/src/blueprint/screens.ts +15 -0
- package/templates/vertical-app/src/env.d.ts +18 -0
- package/templates/vertical-app/src/index.css +139 -0
- package/templates/vertical-app/src/lib/i18n.ts +5 -0
- package/templates/vertical-app/src/lib/iam.ts +19 -0
- package/templates/vertical-app/src/lib/operations.ts +93 -0
- package/templates/vertical-app/src/lib/router.ts +24 -0
- package/templates/vertical-app/src/lib/sdk.ts +21 -0
- package/templates/vertical-app/src/lib/theme.ts +18 -0
- package/templates/vertical-app/src/lib/words.ts +39 -0
- package/templates/vertical-app/src/main.tsx +25 -0
- package/templates/vertical-app/src/pages/AppScreens.tsx +71 -0
- package/templates/vertical-app/src/pages/AuthCallback.tsx +44 -0
- package/templates/vertical-app/src/pages/Home.tsx +36 -0
- package/templates/vertical-app/tsconfig.json +24 -0
- package/templates/vertical-app/vite.config.ts +23 -0
- package/templates/vertical-ci.yml +192 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Portfolio module — `/api/portfolio/*` (person-plane editor) + `/api/public/portfolio/{slug}`
|
|
3
|
+
* (PUBLIC renderer feed). The person's fully-customizable public profile: verified + manual
|
|
4
|
+
* entries, template selection, per-user theme overrides (base ← template ← overrides), ordered
|
|
5
|
+
* sections, share links.
|
|
6
|
+
*/
|
|
7
|
+
import type { Http } from './http.js';
|
|
8
|
+
export interface PortfolioProfile {
|
|
9
|
+
slug: string;
|
|
10
|
+
headline: string | null;
|
|
11
|
+
location: string | null;
|
|
12
|
+
visibility: 'public' | 'unlisted' | 'private';
|
|
13
|
+
template_id: string;
|
|
14
|
+
theme_overrides: Record<string, unknown> | null;
|
|
15
|
+
}
|
|
16
|
+
export interface PortfolioEntry {
|
|
17
|
+
id: string;
|
|
18
|
+
kind: 'verified' | 'manual';
|
|
19
|
+
title: string;
|
|
20
|
+
org_name: string | null;
|
|
21
|
+
role: string | null;
|
|
22
|
+
body: string | null;
|
|
23
|
+
stats: Record<string, unknown> | null;
|
|
24
|
+
is_public: boolean;
|
|
25
|
+
position: number;
|
|
26
|
+
verified_fact_id: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface PortfolioSection {
|
|
29
|
+
key: string;
|
|
30
|
+
position?: number;
|
|
31
|
+
is_visible?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface ResolvedTheme {
|
|
34
|
+
template_id: string;
|
|
35
|
+
mode_default: string;
|
|
36
|
+
font: Record<string, string>;
|
|
37
|
+
motifs: string[];
|
|
38
|
+
layout: string;
|
|
39
|
+
tokens: {
|
|
40
|
+
light: Record<string, string>;
|
|
41
|
+
dark: Record<string, string>;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface MyPortfolioResponse {
|
|
45
|
+
profile: PortfolioProfile;
|
|
46
|
+
theme: ResolvedTheme | Record<string, never>;
|
|
47
|
+
entries: PortfolioEntry[];
|
|
48
|
+
sections: PortfolioSection[];
|
|
49
|
+
}
|
|
50
|
+
export interface UpdateProfileInput {
|
|
51
|
+
headline?: string | null;
|
|
52
|
+
location?: string | null;
|
|
53
|
+
visibility?: 'public' | 'unlisted' | 'private';
|
|
54
|
+
}
|
|
55
|
+
export interface AddEntryInput {
|
|
56
|
+
title: string;
|
|
57
|
+
org_name?: string | null;
|
|
58
|
+
role?: string | null;
|
|
59
|
+
body?: string | null;
|
|
60
|
+
is_public?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export interface UpdateEntryInput {
|
|
63
|
+
title?: string;
|
|
64
|
+
org_name?: string | null;
|
|
65
|
+
role?: string | null;
|
|
66
|
+
body?: string | null;
|
|
67
|
+
is_public?: boolean;
|
|
68
|
+
position?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface PublishFactInput {
|
|
71
|
+
verified_fact_id: string;
|
|
72
|
+
title: string;
|
|
73
|
+
org_name?: string | null;
|
|
74
|
+
role?: string | null;
|
|
75
|
+
}
|
|
76
|
+
export interface ThemeOverridesInput {
|
|
77
|
+
accent?: string | null;
|
|
78
|
+
mode_default?: 'light' | 'dark';
|
|
79
|
+
font?: Record<string, string>;
|
|
80
|
+
}
|
|
81
|
+
/** A showcased award on the public portfolio. */
|
|
82
|
+
export interface PublicAward {
|
|
83
|
+
key: string;
|
|
84
|
+
name: string;
|
|
85
|
+
rarity: string;
|
|
86
|
+
icon: string;
|
|
87
|
+
}
|
|
88
|
+
/** An endorsement on the public portfolio. */
|
|
89
|
+
export interface PublicEndorsement {
|
|
90
|
+
skill: string;
|
|
91
|
+
source: string | null;
|
|
92
|
+
verified: boolean;
|
|
93
|
+
}
|
|
94
|
+
export interface PublicPortfolioResponse {
|
|
95
|
+
profile: {
|
|
96
|
+
slug: string;
|
|
97
|
+
headline: string | null;
|
|
98
|
+
location: string | null;
|
|
99
|
+
};
|
|
100
|
+
theme: ResolvedTheme | Record<string, never>;
|
|
101
|
+
entries: Array<Pick<PortfolioEntry, 'kind' | 'title' | 'org_name' | 'role' | 'body'> & {
|
|
102
|
+
verified: boolean;
|
|
103
|
+
}>;
|
|
104
|
+
sections: Array<{
|
|
105
|
+
key: string;
|
|
106
|
+
position: number;
|
|
107
|
+
}>;
|
|
108
|
+
awards: PublicAward[];
|
|
109
|
+
endorsements: PublicEndorsement[];
|
|
110
|
+
}
|
|
111
|
+
export declare function createPortfolioNamespace(http: Http): {
|
|
112
|
+
/** GET /api/portfolio/me — my profile + entries + sections + resolved theme (provisions on first read). */
|
|
113
|
+
me: () => Promise<MyPortfolioResponse>;
|
|
114
|
+
/** PUT /api/portfolio/me — headline / location / visibility. */
|
|
115
|
+
updateMe: (input: UpdateProfileInput) => Promise<{
|
|
116
|
+
ok: boolean;
|
|
117
|
+
}>;
|
|
118
|
+
/** POST /api/portfolio/entries — add a manual entry. */
|
|
119
|
+
addEntry: (input: AddEntryInput) => Promise<{
|
|
120
|
+
entry: {
|
|
121
|
+
id: string;
|
|
122
|
+
position: number;
|
|
123
|
+
};
|
|
124
|
+
}>;
|
|
125
|
+
/** PATCH /api/portfolio/entries/{id} — edit / reorder / toggle public. */
|
|
126
|
+
updateEntry: (id: string, input: UpdateEntryInput) => Promise<{
|
|
127
|
+
ok: boolean;
|
|
128
|
+
}>;
|
|
129
|
+
/** DELETE /api/portfolio/entries/{id} — remove a manual entry. */
|
|
130
|
+
deleteEntry: (id: string) => Promise<{
|
|
131
|
+
ok: boolean;
|
|
132
|
+
}>;
|
|
133
|
+
/** POST /api/portfolio/publish-fact — publish a verified fact as a verified entry. */
|
|
134
|
+
publishFact: (input: PublishFactInput) => Promise<{
|
|
135
|
+
entry: {
|
|
136
|
+
id: string;
|
|
137
|
+
kind: string;
|
|
138
|
+
};
|
|
139
|
+
}>;
|
|
140
|
+
/** POST /api/portfolio/share-link — mint an opaque share token. */
|
|
141
|
+
shareLink: () => Promise<{
|
|
142
|
+
token: string;
|
|
143
|
+
}>;
|
|
144
|
+
/** GET /api/portfolio/templates — the shipped template library. */
|
|
145
|
+
templates: () => Promise<{
|
|
146
|
+
templates: Array<Record<string, unknown>>;
|
|
147
|
+
}>;
|
|
148
|
+
/** POST /api/portfolio/template — switch template (must be a shipped id). */
|
|
149
|
+
setTemplate: (templateId: string) => Promise<{
|
|
150
|
+
ok: boolean;
|
|
151
|
+
}>;
|
|
152
|
+
/** PUT /api/portfolio/theme — merge per-person theme overrides. */
|
|
153
|
+
updateTheme: (input: ThemeOverridesInput) => Promise<{
|
|
154
|
+
ok: boolean;
|
|
155
|
+
}>;
|
|
156
|
+
/** PUT /api/portfolio/sections — reorder + toggle section visibility. */
|
|
157
|
+
reorderSections: (sections: PortfolioSection[]) => Promise<{
|
|
158
|
+
ok: boolean;
|
|
159
|
+
}>;
|
|
160
|
+
/** GET /api/public/portfolio/{slug} — PUBLIC (no auth): only-public projection + resolved theme. */
|
|
161
|
+
public: (slug: string) => Promise<PublicPortfolioResponse>;
|
|
162
|
+
};
|
|
163
|
+
export type PortfolioNamespace = ReturnType<typeof createPortfolioNamespace>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function createPortfolioNamespace(http) {
|
|
2
|
+
return {
|
|
3
|
+
|
|
4
|
+
me: () => http.get('/api/portfolio/me'),
|
|
5
|
+
|
|
6
|
+
updateMe: (input) => http.put('/api/portfolio/me', input),
|
|
7
|
+
|
|
8
|
+
addEntry: (input) => http.post('/api/portfolio/entries', input),
|
|
9
|
+
|
|
10
|
+
updateEntry: (id, input) => http.patch(`/api/portfolio/entries/${id}`, input),
|
|
11
|
+
|
|
12
|
+
deleteEntry: (id) => http.delete(`/api/portfolio/entries/${id}`),
|
|
13
|
+
|
|
14
|
+
publishFact: (input) => http.post('/api/portfolio/publish-fact', input),
|
|
15
|
+
|
|
16
|
+
shareLink: () => http.post('/api/portfolio/share-link'),
|
|
17
|
+
|
|
18
|
+
templates: () => http.get('/api/portfolio/templates'),
|
|
19
|
+
|
|
20
|
+
setTemplate: (templateId) => http.post('/api/portfolio/template', { template_id: templateId }),
|
|
21
|
+
|
|
22
|
+
updateTheme: (input) => http.put('/api/portfolio/theme', input),
|
|
23
|
+
|
|
24
|
+
reorderSections: (sections) => http.put('/api/portfolio/sections', { sections }),
|
|
25
|
+
|
|
26
|
+
public: (slug) => http.get(`/api/public/portfolio/${slug}`),
|
|
27
|
+
};
|
|
28
|
+
}
|