@unimicro/platform-types 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/LICENSE +238 -0
- package/README.md +59 -0
- package/index.d.ts +13360 -0
- package/package.json +26 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
UNIMICRO PLATFORM SDK LICENCE
|
|
2
|
+
Version 1.0 – 2026
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2026 Unimicro AS. All rights reserved.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
1. DEFINITIONS
|
|
8
|
+
|
|
9
|
+
“Software” means the Unimicro Platform SDK package supplied with this Licence,
|
|
10
|
+
including its source code, object code, type declarations, examples and
|
|
11
|
+
documentation, but excluding Third-Party Components identified by a separate
|
|
12
|
+
licence or notice.
|
|
13
|
+
|
|
14
|
+
“Unimicro Platform” means the software and services operated or supplied by or
|
|
15
|
+
on behalf of Unimicro AS, including its web applications, APIs, developer
|
|
16
|
+
services, plugin runtime and any partner-branded or white-labelled instances
|
|
17
|
+
supplied by Unimicro AS.
|
|
18
|
+
|
|
19
|
+
“Integration” means software or a service developed by or for You that is
|
|
20
|
+
designed to run inside, extend or communicate with the Unimicro Platform through
|
|
21
|
+
interfaces made available or authorised by Unimicro AS. An Integration includes
|
|
22
|
+
a plugin and an application or service that calls Unimicro Platform APIs.
|
|
23
|
+
|
|
24
|
+
“You” means the individual or legal entity exercising rights under this Licence.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
2. ACCEPTANCE
|
|
28
|
+
|
|
29
|
+
By using, copying, modifying or distributing the Software, You accept the terms
|
|
30
|
+
of this Licence.
|
|
31
|
+
|
|
32
|
+
If You do not accept these terms, You may not use, copy, modify or distribute
|
|
33
|
+
the Software.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
3. GRANT
|
|
37
|
+
|
|
38
|
+
Subject to the terms of this Licence, Unimicro AS grants You a perpetual,
|
|
39
|
+
worldwide, royalty-free, non-exclusive licence to:
|
|
40
|
+
|
|
41
|
+
(a) use and copy the Software;
|
|
42
|
+
|
|
43
|
+
(b) modify the Software;
|
|
44
|
+
|
|
45
|
+
(c) use the Software to build, test, operate, maintain and support an
|
|
46
|
+
Integration; and
|
|
47
|
+
|
|
48
|
+
(d) distribute the Software, in source code or object code form, as an
|
|
49
|
+
incorporated, bundled or otherwise necessary part of an Integration.
|
|
50
|
+
|
|
51
|
+
These rights are granted solely for the purpose of developing, testing,
|
|
52
|
+
operating, maintaining, supporting or distributing an Integration.
|
|
53
|
+
|
|
54
|
+
You may use the Software inside Your own organisation and distribute or make
|
|
55
|
+
Your Integration available to others, including commercially.
|
|
56
|
+
|
|
57
|
+
Your employees and contractors may exercise these rights on Your behalf,
|
|
58
|
+
provided that You remain responsible for their compliance with this Licence.
|
|
59
|
+
|
|
60
|
+
The rights granted under this Licence may not otherwise be assigned or
|
|
61
|
+
sublicensed. You may, however, transfer this Licence as part of a merger,
|
|
62
|
+
acquisition, corporate reorganisation or transfer of substantially all assets
|
|
63
|
+
relating to the Integration, provided that the recipient accepts this Licence.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
4. DISTRIBUTION
|
|
67
|
+
|
|
68
|
+
You may distribute the Software only as an incorporated, bundled or otherwise
|
|
69
|
+
necessary part of an Integration.
|
|
70
|
+
|
|
71
|
+
When distributing an Integration that contains the Software or a substantial
|
|
72
|
+
portion of it, You must:
|
|
73
|
+
|
|
74
|
+
(a) include a copy of this Licence;
|
|
75
|
+
|
|
76
|
+
(b) retain all applicable copyright, attribution and legal notices contained in
|
|
77
|
+
the Software;
|
|
78
|
+
|
|
79
|
+
(c) clearly identify files containing material modifications made by You, where
|
|
80
|
+
reasonably practicable; and
|
|
81
|
+
|
|
82
|
+
(d) not impose terms that restrict or contradict the rights granted under this
|
|
83
|
+
Licence with respect to the Software.
|
|
84
|
+
|
|
85
|
+
You may apply any licence terms You choose to Your own Integration, provided
|
|
86
|
+
that those terms do not claim ownership of the Software or alter the terms that
|
|
87
|
+
apply to the Software.
|
|
88
|
+
|
|
89
|
+
You may also make copies of the Software in internal package registries, caches,
|
|
90
|
+
development environments and CI/CD systems where this is reasonably necessary
|
|
91
|
+
to build, test, operate or maintain an Integration.
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
5. RESTRICTIONS
|
|
95
|
+
|
|
96
|
+
You may not:
|
|
97
|
+
|
|
98
|
+
(a) use the Software for any purpose other than the purposes granted in
|
|
99
|
+
section 3;
|
|
100
|
+
|
|
101
|
+
(b) distribute, sell, license or otherwise make the Software available on its
|
|
102
|
+
own, except for internal copies permitted under section 4;
|
|
103
|
+
|
|
104
|
+
(c) distribute the Software as part of software or a service that is not an
|
|
105
|
+
Integration;
|
|
106
|
+
|
|
107
|
+
(d) remove, conceal or alter any copyright, attribution or legal notice
|
|
108
|
+
contained in the Software;
|
|
109
|
+
|
|
110
|
+
(e) use Unimicro’s names, logos, trademarks or other brand elements except to
|
|
111
|
+
state accurately that Your Integration works with the Unimicro Platform; or
|
|
112
|
+
|
|
113
|
+
(f) state or imply that Unimicro AS has approved, certified, endorsed or
|
|
114
|
+
sponsored Your Integration unless Unimicro AS has confirmed this in writing.
|
|
115
|
+
|
|
116
|
+
Any permitted use of Unimicro names or trademarks must comply with applicable
|
|
117
|
+
Unimicro brand and trademark guidelines.
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
6. PLATFORM ACCESS AND OTHER TERMS
|
|
121
|
+
|
|
122
|
+
This Licence governs the Software only.
|
|
123
|
+
|
|
124
|
+
It does not grant You access to the Unimicro Platform, its APIs, plugin runtime,
|
|
125
|
+
Marketplace, developer accounts, customer data or other Unimicro services.
|
|
126
|
+
|
|
127
|
+
Access to and use of the Unimicro Platform may be subject to separate developer
|
|
128
|
+
terms, API terms, Marketplace terms, security requirements, usage limits,
|
|
129
|
+
commercial agreements or other applicable terms issued by Unimicro AS.
|
|
130
|
+
|
|
131
|
+
Unimicro AS may suspend or terminate access to the Unimicro Platform in
|
|
132
|
+
accordance with those separate terms, without terminating Your ownership of
|
|
133
|
+
Your Integration.
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
7. OWNERSHIP
|
|
137
|
+
|
|
138
|
+
The Software is licensed, not sold. Unimicro AS retains all rights, title and
|
|
139
|
+
interest in and to the Software that are not expressly granted under this
|
|
140
|
+
Licence.
|
|
141
|
+
|
|
142
|
+
You retain all rights in the original parts of Your Integration and in
|
|
143
|
+
modifications authored by You.
|
|
144
|
+
|
|
145
|
+
To the extent that Your modifications contain or are derived from the Software,
|
|
146
|
+
Your use and distribution of those modifications remain subject to this
|
|
147
|
+
Licence.
|
|
148
|
+
|
|
149
|
+
Nothing in this Licence transfers ownership of Your Integration to Unimicro AS
|
|
150
|
+
or grants Unimicro AS rights in the original parts of Your Integration.
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
8. PATENTS AND THIRD-PARTY COMPONENTS
|
|
154
|
+
|
|
155
|
+
To the extent that Unimicro AS controls patent claims that are necessarily
|
|
156
|
+
infringed by the permitted use of the Software, Unimicro AS grants You a
|
|
157
|
+
worldwide, royalty-free, non-exclusive patent licence limited to the activities
|
|
158
|
+
permitted under this Licence.
|
|
159
|
+
|
|
160
|
+
This patent licence terminates if You initiate patent proceedings alleging that
|
|
161
|
+
the Software infringes a patent.
|
|
162
|
+
|
|
163
|
+
Third-Party Components included in or distributed with the Software are governed
|
|
164
|
+
by their respective licence terms. This Licence does not replace or modify those
|
|
165
|
+
terms.
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
9. NO WARRANTY OR SUPPORT OBLIGATION
|
|
169
|
+
|
|
170
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
171
|
+
IMPLIED, INCLUDING WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A
|
|
172
|
+
PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
|
173
|
+
|
|
174
|
+
UNIMICRO AS DOES NOT WARRANT THAT THE SOFTWARE WILL BE ERROR-FREE, SECURE,
|
|
175
|
+
CONTINUOUSLY AVAILABLE OR COMPATIBLE WITH FUTURE VERSIONS OF THE UNIMICRO
|
|
176
|
+
PLATFORM.
|
|
177
|
+
|
|
178
|
+
Unless otherwise agreed in writing, Unimicro AS has no obligation to maintain,
|
|
179
|
+
support, update or continue making the Software available.
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
10. LIMITATION OF LIABILITY
|
|
183
|
+
|
|
184
|
+
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, UNIMICRO AS SHALL NOT BE
|
|
185
|
+
LIABLE UNDER ANY LEGAL THEORY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
186
|
+
CONSEQUENTIAL OR EXEMPLARY DAMAGES, OR FOR ANY LOSS OF PROFITS, REVENUE,
|
|
187
|
+
BUSINESS, GOODWILL OR DATA, ARISING OUT OF THIS LICENCE, THE SOFTWARE OR THE USE
|
|
188
|
+
OF OR INABILITY TO USE THE SOFTWARE.
|
|
189
|
+
|
|
190
|
+
Nothing in this Licence excludes or limits liability that cannot lawfully be
|
|
191
|
+
excluded or limited.
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
11. TERMINATION
|
|
195
|
+
|
|
196
|
+
This Licence terminates if You materially breach its terms.
|
|
197
|
+
|
|
198
|
+
If the breach can be remedied, termination takes effect only if You fail to
|
|
199
|
+
remedy the breach within 10 days after becoming aware of it or receiving written
|
|
200
|
+
notice from Unimicro AS.
|
|
201
|
+
|
|
202
|
+
On termination, You must stop using, modifying and distributing the Software
|
|
203
|
+
and remove copies under Your control, except for copies that must be retained by
|
|
204
|
+
law or for internal archival purposes.
|
|
205
|
+
|
|
206
|
+
You may not distribute new Integrations, new versions or updates containing the
|
|
207
|
+
Software after termination.
|
|
208
|
+
|
|
209
|
+
Termination of Your rights does not terminate the rights of recipients who
|
|
210
|
+
received an Integration from You before termination, provided that those
|
|
211
|
+
recipients continue to comply with this Licence. Their rights to included copies
|
|
212
|
+
of the Software are granted directly by Unimicro AS under this Licence.
|
|
213
|
+
|
|
214
|
+
Sections concerning ownership, warranties, liability, termination and governing
|
|
215
|
+
law survive termination to the extent necessary to give them effect.
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
12. GOVERNING LAW AND GENERAL TERMS
|
|
219
|
+
|
|
220
|
+
This Licence is governed by the laws of Norway, without regard to
|
|
221
|
+
conflict-of-law principles.
|
|
222
|
+
|
|
223
|
+
Any dispute arising from this Licence shall be subject to the courts having
|
|
224
|
+
jurisdiction at the registered office of Unimicro AS, unless mandatory law
|
|
225
|
+
requires otherwise.
|
|
226
|
+
|
|
227
|
+
If any provision of this Licence is found to be invalid or unenforceable, the
|
|
228
|
+
remaining provisions remain in effect.
|
|
229
|
+
|
|
230
|
+
Failure to enforce any provision of this Licence does not constitute a waiver of
|
|
231
|
+
that provision.
|
|
232
|
+
|
|
233
|
+
Nothing in this Licence limits any right that cannot lawfully be excluded by
|
|
234
|
+
agreement.
|
|
235
|
+
|
|
236
|
+
Unimicro AS may publish future versions of the Software under different licence
|
|
237
|
+
terms. Such changes do not apply retroactively to a version of the Software that
|
|
238
|
+
You already received under this Licence.
|
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# @unimicro/platform-types
|
|
2
|
+
|
|
3
|
+
Type declarations for the Unimicro Platform's business entities — customers, invoices, accounts,
|
|
4
|
+
employees, and the several hundred others. Types only: this package ships no JavaScript, and
|
|
5
|
+
everything in it erases at build.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install --save-dev @unimicro/platform-types
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Using it from a plugin
|
|
12
|
+
|
|
13
|
+
The host API client takes the entity route as a string and returns whatever you type it as:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import type { Customer } from '@unimicro/platform-types';
|
|
17
|
+
|
|
18
|
+
const customers = await host.api.get<Partial<Customer>[]>('customers', {
|
|
19
|
+
expand: 'Info',
|
|
20
|
+
select: 'ID,CustomerNumber,Info.Name',
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**`Partial`, not the entity itself.** `select` trims the payload, so typing a selected response as a
|
|
25
|
+
whole `Customer` claims fifty fields the object does not have — and the editor then autocompletes
|
|
26
|
+
every one of them, which is worse than no types at all. `Partial` still refuses a field the entity
|
|
27
|
+
does not have, which is the mistake worth catching, while leaving presence to the query.
|
|
28
|
+
|
|
29
|
+
A query with no `select` returns the whole entity and can be typed as one.
|
|
30
|
+
|
|
31
|
+
## Routes are in the types
|
|
32
|
+
|
|
33
|
+
Every entity carries the route it answers on as a literal type:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
type InvoiceRoute = typeof CustomerInvoice.RelativeUrl; // 'invoices' — not 'customerinvoices'
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Worth reading before writing a call. An entity's name and its route are often not the same word, and
|
|
40
|
+
a plausible guess returns a 404 that says nothing about why.
|
|
41
|
+
|
|
42
|
+
**This is a type, not a value.** The package ships no JavaScript, so `CustomerInvoice.RelativeUrl`
|
|
43
|
+
cannot be read at runtime — pass the route as a string and let the literal above be what tells you
|
|
44
|
+
which string. The literal is there so that a typed client can one day infer the route from the
|
|
45
|
+
entity rather than being handed both.
|
|
46
|
+
|
|
47
|
+
## Where this comes from
|
|
48
|
+
|
|
49
|
+
The platform generates these from its own model, and this package is that output as declarations,
|
|
50
|
+
republished whenever the model moves. It is not hand-written and not hand-curated: if an entity is
|
|
51
|
+
in the platform, it is here, and if a field is missing here it is missing there too.
|
|
52
|
+
|
|
53
|
+
Two consequences of that worth knowing. Fields are non-optional in the declarations because the
|
|
54
|
+
model declares them so, which is why `Partial` does the work above. And the types describe the
|
|
55
|
+
platform, not any one company — custom fields do not appear, and arrive under `CustomValues` at
|
|
56
|
+
runtime.
|
|
57
|
+
|
|
58
|
+
For what the fields _mean_ — what a status integer says, which relations have to be expanded, what
|
|
59
|
+
the query syntax accepts — see the `platform-api` skill that ships with the Unimicro CLI.
|