@owlmeans/wled 0.1.18-rc.8 → 0.1.18
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 +13 -11
- package/agent-meta/manifest.json +3 -3
- package/agent-meta/skills/wled/SKILL.md +60 -12
- package/build/entrypoints.d.ts +7 -0
- package/build/entrypoints.d.ts.map +1 -0
- package/build/entrypoints.js +8 -0
- package/build/entrypoints.js.map +1 -0
- package/build/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/schemas.d.ts +9 -0
- package/build/schemas.d.ts.map +1 -0
- package/build/schemas.js +64 -0
- package/build/schemas.js.map +1 -0
- package/build/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/entrypoints.ts +12 -0
- package/src/index.ts +2 -2
- package/src/{model/styles.ts → schemas.ts} +23 -1
- package/src/types.ts +2 -1
- package/src/model/company.ts +0 -17
- package/src/model/index.ts +0 -4
- package/src/model/provider.ts +0 -13
- package/src/modules.ts +0 -11
package/README.md
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
# @owlmeans/wled
|
|
2
2
|
|
|
3
|
-
Whitelabel ("wled") core — shared types, models, and
|
|
3
|
+
Whitelabel ("wled") core — shared types, models, and entrypoint declarations for organization-entity-specific branding/content.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
- `WL_PROVIDE` / `WL_PROVIDE_PATH` —
|
|
7
|
+
- `WL_PROVIDE` / `WL_PROVIDE_PATH` — entrypoint alias and path for the whitelabel provide endpoint
|
|
8
8
|
- `WL_TYPE_COMPANY_INFO`, `WL_TYPE_STYLES`, `WL_TYPE_MEDIA`, `WL_TYPE_DNS` — whitelabel content type discriminators
|
|
9
9
|
- Type definitions: `CompanyInfo`, `CustomStyles`, `CustomColors`, `CustomFont`, `CustomMedia`, `CustomBrand`, `ProvideParams`, `ProvidedWL<T>`
|
|
10
|
-
- `
|
|
11
|
-
- AJV
|
|
10
|
+
- `wledEntrypoints.provide` — immutable protocol for `GET /wl/provide/:entity`
|
|
11
|
+
- AJV schemas in `schemas.ts` (e.g., `ProvideParamsSchema`)
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
bun add @owlmeans/wled
|
|
16
|
+
bun add @owlmeans/wled@^0.1.18
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
Use the shared
|
|
21
|
+
Use the shared protocol declaration and types when wiring server- and web-side whitelabel features:
|
|
22
22
|
|
|
23
23
|
```typescript
|
|
24
|
-
import {
|
|
24
|
+
import { wledEntrypoints } from '@owlmeans/wled'
|
|
25
25
|
import type { ProvidedWL, CompanyInfo, CustomStyles } from '@owlmeans/wled'
|
|
26
26
|
```
|
|
27
27
|
|
|
@@ -50,9 +50,11 @@ The actual server handlers live in `@owlmeans/server-wl`; web UI in `@owlmeans/w
|
|
|
50
50
|
|
|
51
51
|
`CompanyInfo`, `CustomStyles`, `CustomColors`, `CustomFont`, `CustomMedia`, `CustomBrand`, `ProvideParams`, `ProvidedWL<T>` — re-exported at the root entry.
|
|
52
52
|
|
|
53
|
-
### `
|
|
53
|
+
### `wledEntrypoints`
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
Immutable protocol tree with one declaration: `provide` is `GET /wl/provide/:entity` (alias
|
|
56
|
+
`WL_PROVIDE`) with a `params` filter using `ProvideParamsSchema`. Server and browser packages bind
|
|
57
|
+
that exact object into their own local binding lists.
|
|
56
58
|
|
|
57
59
|
### `model`
|
|
58
60
|
|
|
@@ -60,7 +62,7 @@ Submodule exporting AJV schemas (e.g., `ProvideParamsSchema`) and helpers for wh
|
|
|
60
62
|
|
|
61
63
|
## Related Packages
|
|
62
64
|
|
|
63
|
-
- [`@owlmeans/server-wl`](../server-wl) — server-side whitelabel
|
|
65
|
+
- [`@owlmeans/server-wl`](../server-wl) — server-side whitelabel bindings
|
|
64
66
|
- [`@owlmeans/web-wl`](../web-wl) — web UI components for whitelabel content
|
|
65
67
|
- [`@owlmeans/client-wl`](../client-wl) — client-side whitelabel placeholder
|
|
66
68
|
|
|
@@ -72,7 +74,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
72
74
|
your project's skill store (`.agents/skills/`):
|
|
73
75
|
|
|
74
76
|
```sh
|
|
75
|
-
npx @owlmeans/agent-skills
|
|
77
|
+
npx @owlmeans/agent-skills@^0.1.18
|
|
76
78
|
```
|
|
77
79
|
|
|
78
80
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
2
|
+
"schemaVersion": 3,
|
|
3
3
|
"package": "@owlmeans/wled",
|
|
4
|
-
"version": "0.1.18
|
|
5
|
-
"generatedAt": "2026-
|
|
4
|
+
"version": "0.1.18",
|
|
5
|
+
"generatedAt": "2026-10-28T00:31:34.745Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wled
|
|
3
|
-
description: How to use @owlmeans/wled —
|
|
3
|
+
description: How to use @owlmeans/wled — the shared white-label contract — company info, custom styles, brand media and DNS shapes, their AJV schemas, the WL type constants and the single WL_PROVIDE protocol both sides bind. Auto-invoked when importing white-label types or schemas, or when adding a white-label provider.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
---
|
|
6
6
|
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
@@ -8,29 +8,77 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/wled
|
|
9
9
|
|
|
10
10
|
**Layer:** Core
|
|
11
|
-
**Install:** `"@owlmeans/wled": "^0.1.18
|
|
11
|
+
**Install:** `"@owlmeans/wled": "^0.1.18"` in `dependencies`
|
|
12
|
+
|
|
13
|
+
The contract only. It owns no service and reaches no store: it declares the white-label record
|
|
14
|
+
shapes, their schemas, and one entrypoint that the server side answers and the browser side calls.
|
|
15
|
+
Everything that produces a white-label record lives downstream.
|
|
12
16
|
|
|
13
17
|
## Key Exports
|
|
14
18
|
|
|
15
19
|
| Export | Description |
|
|
16
20
|
|--------|-------------|
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
19
|
-
|
|
|
20
|
-
| `
|
|
21
|
+
| `wledEntrypoints.provide` | The `WL_PROVIDE` protocol — a backend `GET /wl/provide/:entity`, with typed params and no guard. Bind it; never redeclare it. |
|
|
22
|
+
| `WL_PROVIDE` | The protocol alias. Both `@owlmeans/server-wl` and `@owlmeans/web-wl` bind this exact declaration. |
|
|
23
|
+
| `WL_PROVIDE_PATH` | `'/wl/provide/:entity'` |
|
|
24
|
+
| `WL_TYPE_COMPANY_INFO`, `WL_TYPE_STYLES`, `WL_TYPE_MEDIA`, `WL_TYPE_DNS` | The `type` a provider stamps on the record it returns — `'company-info'`, `'styles'`, `'media'`, `'dns'` |
|
|
25
|
+
| `ProvidedWL<T>` | What one provider answers: `T & { type: string; exists: boolean \| null }` |
|
|
26
|
+
| `CompanyInfo` | `{ resource?, entityId, fullName, shortName, slug, description }` |
|
|
27
|
+
| `CustomStyles` | `{ resource?, entityId, font, colors }` — a whole theme record, not just the palette |
|
|
28
|
+
| `CustomFont`, `CustomColors` | `{ fontFamily, basicSize? }` (`basicSize` minimum 8), and a required `primaryColor` plus optional secondary/alert/success colours and their backgrounds |
|
|
29
|
+
| `CustomMedia`, `CustomBrand` | `{ brand: { squareLogo?, wideLogo? } }` — both are URLs |
|
|
30
|
+
| `CustomUrls` | `{ adminUrl, userUrl }` |
|
|
31
|
+
| `ProvideParams` | `{ entity: string }` — the one path param |
|
|
32
|
+
| `CompanyInfoSchema`, `CustomStylesSchema`, `CustomFontSchema`, `CustomColorsSchema`, `ColorSchema`, `ProvideParamsSchema` | The AJV schemas for the shapes above. `ajv` is a peer dependency |
|
|
33
|
+
|
|
34
|
+
## The provide contract
|
|
21
35
|
|
|
22
|
-
|
|
36
|
+
`WL_PROVIDE` answers one object per organization entity, keyed by **provider service alias** — not by
|
|
37
|
+
white-label type:
|
|
23
38
|
|
|
24
39
|
```typescript
|
|
25
|
-
import {
|
|
40
|
+
import { WL_TYPE_MEDIA } from '@owlmeans/wled'
|
|
41
|
+
import type { CustomMedia, ProvidedWL } from '@owlmeans/wled'
|
|
26
42
|
|
|
27
|
-
|
|
28
|
-
|
|
43
|
+
// what a provider registered under the alias 'wl-logo' contributes
|
|
44
|
+
const media: ProvidedWL<CustomMedia> = {
|
|
45
|
+
type: WL_TYPE_MEDIA,
|
|
46
|
+
exists: true,
|
|
47
|
+
brand: { wideLogo: 'https://…/wide.png' }
|
|
29
48
|
}
|
|
49
|
+
// → the response carries it as { 'wl-logo': media, 'wl-info': …, 'wl-styles': … }
|
|
30
50
|
```
|
|
31
51
|
|
|
32
|
-
|
|
52
|
+
So a reader picks a section by the alias it registered the provider under, and `type` tells it which
|
|
53
|
+
shape it is holding. `exists` is a tri-state: `true` a stored record, `false` a deliberate empty
|
|
54
|
+
default, `null` unknown.
|
|
55
|
+
|
|
56
|
+
## Rules
|
|
57
|
+
|
|
58
|
+
- **The declaration carries no guard.** Whatever binds `WL_PROVIDE` serves it anonymously unless
|
|
59
|
+
it adds one, so every section a deployment registers is readable by anyone who can name an
|
|
60
|
+
organization. Put nothing in a white-label record that is not meant to be public, or add a guard
|
|
61
|
+
where the entrypoint is bound.
|
|
62
|
+
- `entityId`, `slug` and the `entity` param are declared with `EntityValueSchema` from
|
|
63
|
+
`@owlmeans/auth`, a plain `{ type: 'string', minLength: 3, maxLength: 256 }` — it bounds length and
|
|
64
|
+
nothing else, so a record id and a slug both pass (`CompanyInfo.slug` relaxes `minLength` to 0 on
|
|
65
|
+
top of it). `EntityValueSchema` is `@deprecated` in favour of `EntitySlugValueSchema`, the identical
|
|
66
|
+
schema it aliases; write new fields against the slug schema. What the `entity` param is expected to
|
|
67
|
+
hold is the serving side's rule, not this package's — see the `server-wl` skill.
|
|
68
|
+
- `ColorSchema` accepts `#` followed by 3–8 hex digits (length 4–9), so a named CSS colour or an
|
|
69
|
+
`rgb()` string fails it. That check runs only where `CustomColorsSchema` or `CustomStylesSchema` is
|
|
70
|
+
actually applied — this package's own entrypoint filter validates the path params alone, so a
|
|
71
|
+
package that stores styles must put the schema in its own filter or run it itself.
|
|
72
|
+
- `CustomStylesSchema` requires only `font` and `colors`, while the `CustomStyles` type also requires
|
|
73
|
+
`entityId`. Construct the record from the type — an object that satisfies the schema can still be
|
|
74
|
+
missing the id every provider keys on.
|
|
75
|
+
- Colours and fonts are all optional except `primaryColor` and `fontFamily` — a consumer must render
|
|
76
|
+
with whatever subset it gets rather than assuming a full palette.
|
|
33
77
|
|
|
34
78
|
## Depends On
|
|
35
79
|
|
|
36
|
-
- `@owlmeans/entrypoint`, `@owlmeans/route`, `@owlmeans/auth
|
|
80
|
+
- `@owlmeans/entrypoint`, `@owlmeans/route`, `@owlmeans/auth`
|
|
81
|
+
- `ajv` (peer)
|
|
82
|
+
|
|
83
|
+
Server side binds the declaration through `@owlmeans/server-wl`; browser side through
|
|
84
|
+
`@owlmeans/web-wl`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAK/C,eAAO,MAAM,eAAe;IAC1B,OAAO;;;CAIR,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { contract, protocol, typed } from '@owlmeans/entrypoint';
|
|
2
|
+
import { route, backend } from '@owlmeans/route';
|
|
3
|
+
import { WL_PROVIDE, WL_PROVIDE_PATH } from './consts.js';
|
|
4
|
+
import { ProvideParamsSchema } from './schemas.js';
|
|
5
|
+
export const wledEntrypoints = {
|
|
6
|
+
provide: protocol(route(WL_PROVIDE, WL_PROVIDE_PATH, backend()), contract.request({ params: typed(ProvideParamsSchema) }, typed()))
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=entrypoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAEhE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAElD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,QAAQ,CACf,KAAK,CAAC,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC,EAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAgB,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CACjF;CACF,CAAA"}
|
package/build/index.d.ts
CHANGED
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,mBAAmB,YAAY,CAAA;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,mBAAmB,YAAY,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA"}
|
package/build/index.js
CHANGED
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JSONSchemaType } from 'ajv';
|
|
2
|
+
import type { CompanyInfo, CustomColors, CustomFont, CustomStyles, ProvideParams } from './types.js';
|
|
3
|
+
export declare const CompanyInfoSchema: JSONSchemaType<CompanyInfo>;
|
|
4
|
+
export declare const CustomFontSchema: JSONSchemaType<CustomFont>;
|
|
5
|
+
export declare const ColorSchema: JSONSchemaType<string>;
|
|
6
|
+
export declare const CustomColorsSchema: JSONSchemaType<CustomColors>;
|
|
7
|
+
export declare const CustomStylesSchema: JSONSchemaType<CustomStyles>;
|
|
8
|
+
export declare const ProvideParamsSchema: JSONSchemaType<ProvideParams>;
|
|
9
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAGpG,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,WAAW,CAYzD,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,UAAU,CAQvD,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,cAAc,CAAC,MAAM,CAK9C,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,YAAY,CAc3D,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,YAAY,CAU3D,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,cAAc,CAAC,aAAa,CAO7D,CAAA"}
|
package/build/schemas.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { EntityValueSchema, ResourceValueSchema } from '@owlmeans/auth';
|
|
2
|
+
export const CompanyInfoSchema = {
|
|
3
|
+
type: 'object',
|
|
4
|
+
properties: {
|
|
5
|
+
resource: { ...ResourceValueSchema, minLength: 0, nullable: true },
|
|
6
|
+
entityId: { ...EntityValueSchema },
|
|
7
|
+
fullName: { type: 'string', minLength: 1, maxLength: 128 },
|
|
8
|
+
shortName: { type: 'string', minLength: 0, maxLength: 32 },
|
|
9
|
+
slug: { ...EntityValueSchema, minLength: 0 },
|
|
10
|
+
description: { type: 'string', minLength: 0, maxLength: 512 }
|
|
11
|
+
},
|
|
12
|
+
required: ['entityId', 'fullName', 'shortName', 'slug', 'description'],
|
|
13
|
+
additionalProperties: false,
|
|
14
|
+
};
|
|
15
|
+
export const CustomFontSchema = {
|
|
16
|
+
type: 'object',
|
|
17
|
+
properties: {
|
|
18
|
+
fontFamily: { type: 'string', minLength: 0, maxLength: 128 },
|
|
19
|
+
basicSize: { type: 'number', minimum: 8, nullable: true, }
|
|
20
|
+
},
|
|
21
|
+
required: ['fontFamily'],
|
|
22
|
+
additionalProperties: false,
|
|
23
|
+
};
|
|
24
|
+
export const ColorSchema = {
|
|
25
|
+
type: 'string',
|
|
26
|
+
pattern: '^#(\\d|[a-fA-F]){3,8}$',
|
|
27
|
+
minLength: 4,
|
|
28
|
+
maxLength: 9
|
|
29
|
+
};
|
|
30
|
+
export const CustomColorsSchema = {
|
|
31
|
+
type: 'object',
|
|
32
|
+
properties: {
|
|
33
|
+
primaryColor: ColorSchema,
|
|
34
|
+
secondaryColor: { ...ColorSchema, nullable: true },
|
|
35
|
+
alertColor: { ...ColorSchema, nullable: true },
|
|
36
|
+
successColor: { ...ColorSchema, nullable: true },
|
|
37
|
+
primaryBackground: { ...ColorSchema, nullable: true },
|
|
38
|
+
secondaryBackground: { ...ColorSchema, nullable: true },
|
|
39
|
+
alertBackground: { ...ColorSchema, nullable: true },
|
|
40
|
+
successBackground: { ...ColorSchema, nullable: true },
|
|
41
|
+
},
|
|
42
|
+
required: ['primaryColor'],
|
|
43
|
+
additionalProperties: false,
|
|
44
|
+
};
|
|
45
|
+
export const CustomStylesSchema = {
|
|
46
|
+
type: 'object',
|
|
47
|
+
properties: {
|
|
48
|
+
resource: { ...ResourceValueSchema, minLength: 0, nullable: true },
|
|
49
|
+
entityId: { ...EntityValueSchema },
|
|
50
|
+
font: CustomFontSchema,
|
|
51
|
+
colors: CustomColorsSchema
|
|
52
|
+
},
|
|
53
|
+
required: ['font', 'colors'],
|
|
54
|
+
additionalProperties: false,
|
|
55
|
+
};
|
|
56
|
+
export const ProvideParamsSchema = {
|
|
57
|
+
type: 'object',
|
|
58
|
+
properties: {
|
|
59
|
+
entity: { ...EntityValueSchema }
|
|
60
|
+
},
|
|
61
|
+
required: ['entity'],
|
|
62
|
+
additionalProperties: false,
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEvE,MAAM,CAAC,MAAM,iBAAiB,GAAgC;IAC5D,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,GAAG,mBAAmB,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;QAClE,QAAQ,EAAE,EAAE,GAAG,iBAAiB,EAAE;QAClC,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE;QAC1D,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,EA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MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,WAAW,CAAA;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAGD,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,OAAO,GAAG,IAAI,CAAA;CACvB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/wled",
|
|
3
|
-
"version": "0.1.18
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"ajv": "*"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@owlmeans/auth": "^0.1.18
|
|
28
|
-
"@owlmeans/entrypoint": "^0.1.18
|
|
29
|
-
"@owlmeans/route": "^0.1.18
|
|
27
|
+
"@owlmeans/auth": "^0.1.18",
|
|
28
|
+
"@owlmeans/entrypoint": "^0.1.18",
|
|
29
|
+
"@owlmeans/route": "^0.1.18"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@owlmeans/dep-config": "
|
|
32
|
+
"@owlmeans/dep-config": "^0.1.18",
|
|
33
33
|
"nodemon": "^3.1.14",
|
|
34
34
|
"typescript": "^7.0.2"
|
|
35
35
|
},
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { contract, protocol, typed } from '@owlmeans/entrypoint'
|
|
2
|
+
import type { ProvideParams } from './types.js'
|
|
3
|
+
import { route, backend } from '@owlmeans/route'
|
|
4
|
+
import { WL_PROVIDE, WL_PROVIDE_PATH } from './consts.js'
|
|
5
|
+
import { ProvideParamsSchema } from './schemas.js'
|
|
6
|
+
|
|
7
|
+
export const wledEntrypoints = {
|
|
8
|
+
provide: protocol(
|
|
9
|
+
route(WL_PROVIDE, WL_PROVIDE_PATH, backend()),
|
|
10
|
+
contract.request({ params: typed<ProvideParams>(ProvideParamsSchema) }, typed())
|
|
11
|
+
)
|
|
12
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import type { JSONSchemaType } from 'ajv'
|
|
2
|
-
import type {
|
|
2
|
+
import type { CompanyInfo, CustomColors, CustomFont, CustomStyles, ProvideParams } from './types.js'
|
|
3
3
|
import { EntityValueSchema, ResourceValueSchema } from '@owlmeans/auth'
|
|
4
4
|
|
|
5
|
+
export const CompanyInfoSchema: JSONSchemaType<CompanyInfo> = {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
resource: { ...ResourceValueSchema, minLength: 0, nullable: true },
|
|
9
|
+
entityId: { ...EntityValueSchema },
|
|
10
|
+
fullName: { type: 'string', minLength: 1, maxLength: 128 },
|
|
11
|
+
shortName: { type: 'string', minLength: 0, maxLength: 32 },
|
|
12
|
+
slug: { ...EntityValueSchema, minLength: 0 },
|
|
13
|
+
description: { type: 'string', minLength: 0, maxLength: 512 }
|
|
14
|
+
},
|
|
15
|
+
required: ['entityId', 'fullName', 'shortName', 'slug', 'description'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
}
|
|
18
|
+
|
|
5
19
|
export const CustomFontSchema: JSONSchemaType<CustomFont> = {
|
|
6
20
|
type: 'object',
|
|
7
21
|
properties: {
|
|
@@ -47,3 +61,11 @@ export const CustomStylesSchema: JSONSchemaType<CustomStyles> = {
|
|
|
47
61
|
additionalProperties: false,
|
|
48
62
|
}
|
|
49
63
|
|
|
64
|
+
export const ProvideParamsSchema: JSONSchemaType<ProvideParams> = {
|
|
65
|
+
type: 'object',
|
|
66
|
+
properties: {
|
|
67
|
+
entity: { ...EntityValueSchema }
|
|
68
|
+
},
|
|
69
|
+
required: ['entity'],
|
|
70
|
+
additionalProperties: false,
|
|
71
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -44,11 +44,12 @@ export interface ProvideParams {
|
|
|
44
44
|
entity: string
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
export interface CustomUrls {
|
|
48
48
|
adminUrl: string
|
|
49
49
|
userUrl: string
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
// Kept as a type: it intersects its type parameter, which an interface cannot extend.
|
|
52
53
|
export type ProvidedWL<T extends {} = {}> = T & {
|
|
53
54
|
type: string
|
|
54
55
|
exists: boolean | null
|
package/src/model/company.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { JSONSchemaType } from 'ajv'
|
|
2
|
-
import type { CompanyInfo } from '../types.js'
|
|
3
|
-
import { EntityValueSchema, ResourceValueSchema } from '@owlmeans/auth'
|
|
4
|
-
|
|
5
|
-
export const CompanyInfoSchema: JSONSchemaType<CompanyInfo> = {
|
|
6
|
-
type: 'object',
|
|
7
|
-
properties: {
|
|
8
|
-
resource: { ...ResourceValueSchema, minLength: 0, nullable: true },
|
|
9
|
-
entityId: { ...EntityValueSchema },
|
|
10
|
-
fullName: { type: 'string', minLength: 1, maxLength: 128 },
|
|
11
|
-
shortName: { type: 'string', minLength: 0, maxLength: 32 },
|
|
12
|
-
slug: { ...EntityValueSchema, minLength: 0 },
|
|
13
|
-
description: { type: 'string', minLength: 0, maxLength: 512 }
|
|
14
|
-
},
|
|
15
|
-
required: ['entityId', 'fullName', 'shortName', 'slug', 'description'],
|
|
16
|
-
additionalProperties: false,
|
|
17
|
-
}
|
package/src/model/index.ts
DELETED
package/src/model/provider.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import type { JSONSchemaType } from 'ajv'
|
|
3
|
-
import type { ProvideParams } from '../types.js'
|
|
4
|
-
import { EntityValueSchema } from '@owlmeans/auth'
|
|
5
|
-
|
|
6
|
-
export const ProvideParamsSchema: JSONSchemaType<ProvideParams> = {
|
|
7
|
-
type: 'object',
|
|
8
|
-
properties: {
|
|
9
|
-
entity: { ...EntityValueSchema }
|
|
10
|
-
},
|
|
11
|
-
required: ['entity'],
|
|
12
|
-
additionalProperties: false,
|
|
13
|
-
}
|
package/src/modules.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { filter, entrypoint, params } from '@owlmeans/entrypoint'
|
|
2
|
-
import { route, backend } from '@owlmeans/route'
|
|
3
|
-
import { WL_PROVIDE, WL_PROVIDE_PATH } from './consts.js'
|
|
4
|
-
import { ProvideParamsSchema } from './model/provider.js'
|
|
5
|
-
|
|
6
|
-
export const modules = [
|
|
7
|
-
entrypoint(
|
|
8
|
-
route(WL_PROVIDE, WL_PROVIDE_PATH, backend()),
|
|
9
|
-
filter(params(ProvideParamsSchema))
|
|
10
|
-
)
|
|
11
|
-
]
|