@appsemble/types 0.20.42 → 0.20.43

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.md ADDED
@@ -0,0 +1,126 @@
1
+ # GNU LESSER GENERAL PUBLIC LICENSE
2
+
3
+ Version 3, 29 June 2007
4
+
5
+ Copyright © 2018 Appsemble B.V. <https://appsemble.com>
6
+
7
+ Everyone is permitted to copy and distribute verbatim copies of this license document, but changing
8
+ it is not allowed.
9
+
10
+ This version of the GNU Lesser General Public License incorporates the terms and conditions of
11
+ version 3 of the GNU General Public License, supplemented by the additional permissions listed
12
+ below.
13
+
14
+ ## 0. Additional Definitions.
15
+
16
+ As used herein, _“this License”_ refers to version 3 of the GNU Lesser General Public License, and
17
+ the _“GNU GPL”_ refers to version 3 of the GNU General Public License.
18
+
19
+ _“The Library”_ refers to a covered work governed by this License, other than an Application or a
20
+ Combined Work as defined below.
21
+
22
+ An _“Application”_ is any work that makes use of an interface provided by the Library, but which is
23
+ not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed
24
+ a mode of using an interface provided by the Library.
25
+
26
+ A _“Combined Work”_ is a work produced by combining or linking an Application with the Library. The
27
+ particular version of the Library with which the Combined Work was made is also called the _“Linked
28
+ Version”_.
29
+
30
+ The _“Minimal Corresponding Source”_ for a Combined Work means the Corresponding Source for the
31
+ Combined Work, excluding any source code for portions of the Combined Work that, considered in
32
+ isolation, are based on the Application, and not on the Linked Version.
33
+
34
+ The _“Corresponding Application Code”_ for a Combined Work means the object code and/or source code
35
+ for the Application, including any data and utility programs needed for reproducing the Combined
36
+ Work from the Application, but excluding the System Libraries of the Combined Work.
37
+
38
+ ## 1. Exception to Section 3 of the GNU GPL.
39
+
40
+ You may convey a covered work under sections 3 and 4 of this License without being bound by section
41
+ 3 of the GNU GPL.
42
+
43
+ ## 2. Conveying Modified Versions.
44
+
45
+ If you modify a copy of the Library, and, in your modifications, a facility refers to a function or
46
+ data to be supplied by an Application that uses the facility (other than as an argument passed when
47
+ the facility is invoked), then you may convey a copy of the modified version:
48
+
49
+ - a) under this License, provided that you make a good faith effort to ensure that, in the event an
50
+ Application does not supply the function or data, the facility still operates, and performs
51
+ whatever part of its purpose remains meaningful, or
52
+ - b) under the GNU GPL, with none of the additional permissions of this License applicable to that
53
+ copy.
54
+
55
+ ## 3. Object Code Incorporating Material from Library Header Files.
56
+
57
+ The object code form of an Application may incorporate material from a header file that is part of
58
+ the Library. You may convey such object code under terms of your choice, provided that, if the
59
+ incorporated material is not limited to numerical parameters, data structure layouts and accessors,
60
+ or small macros, inline functions and templates (ten or fewer lines in length), you do both of the
61
+ following:
62
+
63
+ - a) Give prominent notice with each copy of the object code that the Library is used in it and that
64
+ the Library and its use are covered by this License.
65
+ - b) Accompany the object code with a copy of the GNU GPL and this license document.
66
+
67
+ ## 4. Combined Works.
68
+
69
+ You may convey a Combined Work under terms of your choice that, taken together, effectively do not
70
+ restrict modification of the portions of the Library contained in the Combined Work and reverse
71
+ engineering for debugging such modifications, if you also do each of the following:
72
+
73
+ - a) Give prominent notice with each copy of the Combined Work that the Library is used in it and
74
+ that the Library and its use are covered by this License.
75
+ - b) Accompany the Combined Work with a copy of the GNU GPL and this license document.
76
+ - c) For a Combined Work that displays copyright notices during execution, include the copyright
77
+ notice for the Library among these notices, as well as a reference directing the user to the
78
+ copies of the GNU GPL and this license document.
79
+ - d) Do one of the following:
80
+ 1. Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding
81
+ Application Code in a form suitable for, and under terms that permit, the user to recombine or
82
+ relink the Application with a modified version of the Linked Version to produce a modified
83
+ Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding
84
+ Source.
85
+ 2. Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is
86
+ one that (a) uses at run time a copy of the Library already present on the user’s computer
87
+ system, and (b) will operate properly with a modified version of the Library that is
88
+ interface-compatible with the Linked Version.
89
+ - e) Provide Installation Information, but only if you would otherwise be required to provide such
90
+ information under section 6 of the GNU GPL, and only to the extent that such information is
91
+ necessary to install and execute a modified version of the Combined Work produced by recombining
92
+ or relinking the Application with a modified version of the Linked Version. (If you use option
93
+ 4d0, the Installation Information must accompany the Minimal Corresponding Source and
94
+ Corresponding Application Code. If you use option 4d1, you must provide the Installation
95
+ Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding
96
+ Source.)
97
+
98
+ ## 5. Combined Libraries.
99
+
100
+ You may place library facilities that are a work based on the Library side by side in a single
101
+ library together with other library facilities that are not Applications and are not covered by this
102
+ License, and convey such a combined library under terms of your choice, if you do both of the
103
+ following:
104
+
105
+ - a) Accompany the combined library with a copy of the same work based on the Library, uncombined
106
+ with any other library facilities, conveyed under the terms of this License.
107
+ - b) Give prominent notice with the combined library that part of it is a work based on the Library,
108
+ and explaining where to find the accompanying uncombined form of the same work.
109
+
110
+ ## 6. Revised Versions of the GNU Lesser General Public License.
111
+
112
+ The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General
113
+ Public License from time to time. Such new versions will be similar in spirit to the present
114
+ version, but may differ in detail to address new problems or concerns.
115
+
116
+ Each version is given a distinguishing version number. If the Library as you received it specifies
117
+ that a certain numbered version of the GNU Lesser General Public License _“or any later version”_
118
+ applies to it, you have the option of following the terms and conditions either of that published
119
+ version or of any later version published by the Free Software Foundation. If the Library as you
120
+ received it does not specify a version number of the GNU Lesser General Public License, you may
121
+ choose any version of the GNU Lesser General Public License ever published by the Free Software
122
+ Foundation.
123
+
124
+ If the Library as you received it specifies that a proxy can decide whether future versions of the
125
+ GNU Lesser General Public License shall apply, that proxy’s public statement of acceptance of any
126
+ version is permanent authorization for you to choose that version for the Library.
package/README.md CHANGED
@@ -1,11 +1,17 @@
1
- # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.20.42/config/assets/logo.svg) Appsemble Types
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.20.43/config/assets/logo.svg) Appsemble Types
2
2
 
3
3
  > Reusable TypeScript types
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@appsemble/types)](https://www.npmjs.com/package/@appsemble/types)
6
- [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.20.42/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.20.42)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.20.43/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.20.43)
7
7
  [![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io)
8
8
 
9
+ ## Table of Contents
10
+
11
+ - [Installation](#installation)
12
+ - [Usage](#usage)
13
+ - [License](#license)
14
+
9
15
  ## Installation
10
16
 
11
17
  ```sh
@@ -20,5 +26,5 @@ not guaranteed.
20
26
 
21
27
  ## License
22
28
 
23
- [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.20.42/LICENSE.md) ©
29
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.20.43/LICENSE.md) ©
24
30
  [Appsemble](https://appsemble.com)
package/action.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { HTTPMethods } from './http.js';
2
- import { Remapper } from './index.js';
1
+ import { type HTTPMethods } from './http.js';
2
+ import { type Remapper } from './index.js';
3
3
  interface BaseAction<T extends string> {
4
4
  /**
5
5
  * A function which can be called to dispatch the action.
package/appMember.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { IconName } from '@fortawesome/fontawesome-common-types';
2
- import { App } from './index.js';
1
+ import { type IconName } from '@fortawesome/fontawesome-common-types';
2
+ import { type App } from './index.js';
3
3
  export interface SSOConfiguration {
4
4
  type: 'oauth2' | 'saml';
5
5
  url: string;
package/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import { IconName } from '@fortawesome/fontawesome-common-types';
2
- import { Schema } from 'jsonschema';
3
- import { OpenAPIV3 } from 'openapi-types';
4
- import { JsonObject, RequireExactlyOne } from 'type-fest';
5
- import { Action, LogAction } from './action.js';
6
- import { AppVisibility, TeamsDefinition } from './app.js';
7
- import { BulmaColor } from './bulma.js';
8
- import { HTTPMethods } from './http.js';
9
- import { Theme } from './theme.js';
1
+ import { type IconName } from '@fortawesome/fontawesome-common-types';
2
+ import { type Schema } from 'jsonschema';
3
+ import { type OpenAPIV3 } from 'openapi-types';
4
+ import { type JsonObject, type RequireExactlyOne } from 'type-fest';
5
+ import { type Action, type LogAction } from './action.js';
6
+ import { type AppVisibility, type TeamsDefinition } from './app.js';
7
+ import { type BulmaColor } from './bulma.js';
8
+ import { type HTTPMethods } from './http.js';
9
+ import { type Theme } from './theme.js';
10
10
  export * from './action.js';
11
11
  export * from './app.js';
12
12
  export * from './appMember.js';
@@ -264,6 +264,14 @@ export interface Remappers {
264
264
  * Returns `true` if all entries are equal, otherwise `false`.
265
265
  */
266
266
  equals: Remapper[];
267
+ /**
268
+ * Compare all computed remapper values against the first.
269
+ *
270
+ * Returns `false` if all entries are equal to the first entry, otherwise `true`.
271
+ *
272
+ * If only 1 or less are passed to it `false` is returned.
273
+ */
274
+ not: Remapper[];
267
275
  /**
268
276
  * Get data stored at the current flow page step
269
277
  */
@@ -280,6 +288,12 @@ export interface Remappers {
280
288
  * Returns `true` of the first entry is less than the second entry.
281
289
  */
282
290
  lt: [Remapper, Remapper];
291
+ /**
292
+ * Logs its input data (returns it) and its context.
293
+ *
294
+ * The value to set is the log level.
295
+ */
296
+ log: 'error' | 'info' | 'warn';
283
297
  /**
284
298
  * Builds an array based on the given data and remappers.
285
299
  *
@@ -313,6 +327,15 @@ export interface Remappers {
313
327
  then: Remapper;
314
328
  else: Remapper;
315
329
  };
330
+ /**
331
+ * Check if any case results in a truthy value.
332
+ *
333
+ * Returns the value of the first case where the condition equals true, otherwise returns null.
334
+ */
335
+ match: {
336
+ case: Remapper;
337
+ value: Remapper;
338
+ }[];
316
339
  /**
317
340
  * Get the current array.map’s index or length.
318
341
  *
@@ -1767,6 +1790,37 @@ export interface OAuth2Provider {
1767
1790
  */
1768
1791
  scope: string;
1769
1792
  }
1793
+ export type ServiceAuthenticationMethod = 'client-certificate' | 'client-credentials' | 'cookie' | 'custom-header' | 'http-basic' | 'query-parameter';
1794
+ export interface AppServiceSecret {
1795
+ /**
1796
+ * An autogenerated ID.
1797
+ */
1798
+ id?: number;
1799
+ /**
1800
+ * An optional name to give extra clarity what the secret is used for.
1801
+ */
1802
+ serviceName?: string;
1803
+ /**
1804
+ * The url pattern that is matched when a proxied request action is called.
1805
+ */
1806
+ urlPatterns: string;
1807
+ /**
1808
+ * The method to authenticate the request action with.
1809
+ */
1810
+ authenticationMethod: ServiceAuthenticationMethod;
1811
+ /**
1812
+ * The parameter name, header name, username or certificate that goes with the secret.
1813
+ */
1814
+ identifier?: string;
1815
+ /**
1816
+ * The secret to authenticate the proxied outgoing request with.
1817
+ */
1818
+ secret?: string;
1819
+ /**
1820
+ * The tokenUrl used for client-credentials method.
1821
+ */
1822
+ tokenUrl?: string;
1823
+ }
1770
1824
  export interface AppOAuth2Secret extends OAuth2Provider {
1771
1825
  /**
1772
1826
  * An autogenerated ID.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsemble/types",
3
- "version": "0.20.42",
3
+ "version": "0.20.43",
4
4
  "description": "TypeScript definitions reused within Appsemble internally",
5
5
  "keywords": [
6
6
  "app",
package/snapshot.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Author } from './author.js';
1
+ import { type Author } from './author.js';
2
2
  /**
3
3
  * A snapshot of an app.
4
4
  */
package/template.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AppVisibility } from './app.js';
1
+ import { type AppVisibility } from './app.js';
2
2
  export interface Template {
3
3
  /**
4
4
  * The id of the app to clone.