@3sixty/api-tenant-processor 0.0.0-stage → 0.20.0-next.0
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 +201 -0
- package/README.md +24 -2
- package/dist/es/entities/tenant.js +77 -0
- package/dist/es/entities/tenant.js.map +1 -0
- package/dist/es/entities/tenantV0.js +61 -0
- package/dist/es/entities/tenantV0.js.map +1 -0
- package/dist/es/entities/tenantV1.js +77 -0
- package/dist/es/entities/tenantV1.js.map +1 -0
- package/dist/es/index.js +29 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/ISingleTenantProcessorConfig.js +4 -0
- package/dist/es/models/ISingleTenantProcessorConfig.js.map +1 -0
- package/dist/es/models/ISingleTenantProcessorConstructorOptions.js +2 -0
- package/dist/es/models/ISingleTenantProcessorConstructorOptions.js.map +1 -0
- package/dist/es/models/ITenantAdminServiceConfig.js +4 -0
- package/dist/es/models/ITenantAdminServiceConfig.js.map +1 -0
- package/dist/es/models/ITenantAdminServiceConstructorOptions.js +2 -0
- package/dist/es/models/ITenantAdminServiceConstructorOptions.js.map +1 -0
- package/dist/es/models/ITenantOverrideProcessorConfig.js +4 -0
- package/dist/es/models/ITenantOverrideProcessorConfig.js.map +1 -0
- package/dist/es/models/ITenantOverrideProcessorConstructorOptions.js +2 -0
- package/dist/es/models/ITenantOverrideProcessorConstructorOptions.js.map +1 -0
- package/dist/es/models/ITenantProcessorConfig.js +4 -0
- package/dist/es/models/ITenantProcessorConfig.js.map +1 -0
- package/dist/es/models/ITenantProcessorConstructorOptions.js +2 -0
- package/dist/es/models/ITenantProcessorConstructorOptions.js.map +1 -0
- package/dist/es/models/api/ITenantCreateRequest.js +2 -0
- package/dist/es/models/api/ITenantCreateRequest.js.map +1 -0
- package/dist/es/models/api/ITenantGetByApiKeyRequest.js +4 -0
- package/dist/es/models/api/ITenantGetByApiKeyRequest.js.map +1 -0
- package/dist/es/models/api/ITenantGetByIdRequest.js +4 -0
- package/dist/es/models/api/ITenantGetByIdRequest.js.map +1 -0
- package/dist/es/models/api/ITenantGetByPublicOriginRequest.js +4 -0
- package/dist/es/models/api/ITenantGetByPublicOriginRequest.js.map +1 -0
- package/dist/es/models/api/ITenantGetResponse.js +2 -0
- package/dist/es/models/api/ITenantGetResponse.js.map +1 -0
- package/dist/es/models/api/ITenantListRequest.js +4 -0
- package/dist/es/models/api/ITenantListRequest.js.map +1 -0
- package/dist/es/models/api/ITenantListResponse.js +2 -0
- package/dist/es/models/api/ITenantListResponse.js.map +1 -0
- package/dist/es/models/api/ITenantRemoveRequest.js +4 -0
- package/dist/es/models/api/ITenantRemoveRequest.js.map +1 -0
- package/dist/es/models/api/ITenantUpdateRequest.js +2 -0
- package/dist/es/models/api/ITenantUpdateRequest.js.map +1 -0
- package/dist/es/restEntryPoints.js +13 -0
- package/dist/es/restEntryPoints.js.map +1 -0
- package/dist/es/schema.js +64 -0
- package/dist/es/schema.js.map +1 -0
- package/dist/es/singleTenantProcessor.js +81 -0
- package/dist/es/singleTenantProcessor.js.map +1 -0
- package/dist/es/tenantAdminService.js +500 -0
- package/dist/es/tenantAdminService.js.map +1 -0
- package/dist/es/tenantIdContextIdHandler.js +47 -0
- package/dist/es/tenantIdContextIdHandler.js.map +1 -0
- package/dist/es/tenantOverrideProcessor.js +119 -0
- package/dist/es/tenantOverrideProcessor.js.map +1 -0
- package/dist/es/tenantProcessor.js +164 -0
- package/dist/es/tenantProcessor.js.map +1 -0
- package/dist/es/tenantRoutes.js +404 -0
- package/dist/es/tenantRoutes.js.map +1 -0
- package/dist/es/utils/tenantIdHelper.js +23 -0
- package/dist/es/utils/tenantIdHelper.js.map +1 -0
- package/dist/types/entities/tenant.d.ts +37 -0
- package/dist/types/entities/tenantV0.d.ts +29 -0
- package/dist/types/entities/tenantV1.d.ts +37 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/models/ISingleTenantProcessorConfig.d.ts +9 -0
- package/dist/types/models/ISingleTenantProcessorConstructorOptions.d.ts +10 -0
- package/dist/types/models/ITenantAdminServiceConfig.d.ts +24 -0
- package/dist/types/models/ITenantAdminServiceConstructorOptions.d.ts +15 -0
- package/dist/types/models/ITenantOverrideProcessorConfig.d.ts +13 -0
- package/dist/types/models/ITenantOverrideProcessorConstructorOptions.d.ts +15 -0
- package/dist/types/models/ITenantProcessorConfig.d.ts +18 -0
- package/dist/types/models/ITenantProcessorConstructorOptions.d.ts +15 -0
- package/dist/types/models/api/ITenantCreateRequest.d.ts +12 -0
- package/dist/types/models/api/ITenantGetByApiKeyRequest.d.ts +14 -0
- package/dist/types/models/api/ITenantGetByIdRequest.d.ts +14 -0
- package/dist/types/models/api/ITenantGetByPublicOriginRequest.d.ts +14 -0
- package/dist/types/models/api/ITenantGetResponse.d.ts +10 -0
- package/dist/types/models/api/ITenantListRequest.d.ts +27 -0
- package/dist/types/models/api/ITenantListResponse.d.ts +17 -0
- package/dist/types/models/api/ITenantRemoveRequest.d.ts +14 -0
- package/dist/types/models/api/ITenantUpdateRequest.d.ts +19 -0
- package/dist/types/restEntryPoints.d.ts +5 -0
- package/dist/types/schema.d.ts +5 -0
- package/dist/types/singleTenantProcessor.d.ts +41 -0
- package/dist/types/tenantAdminService.d.ts +109 -0
- package/dist/types/tenantIdContextIdHandler.d.ts +33 -0
- package/dist/types/tenantOverrideProcessor.d.ts +44 -0
- package/dist/types/tenantProcessor.d.ts +34 -0
- package/dist/types/tenantRoutes.d.ts +78 -0
- package/dist/types/utils/tenantIdHelper.d.ts +15 -0
- package/docs/changelog.md +0 -0
- package/docs/examples.md +81 -0
- package/docs/reference/classes/SingleTenantProcessor.md +128 -0
- package/docs/reference/classes/Tenant.md +77 -0
- package/docs/reference/classes/TenantAdminService.md +393 -0
- package/docs/reference/classes/TenantIdContextIdHandler.md +123 -0
- package/docs/reference/classes/TenantIdHelper.md +41 -0
- package/docs/reference/classes/TenantOverrideProcessor.md +119 -0
- package/docs/reference/classes/TenantProcessor.md +101 -0
- package/docs/reference/functions/generateRestRoutesTenants.md +25 -0
- package/docs/reference/functions/initSchema.md +10 -0
- package/docs/reference/functions/tenantByApiKey.md +31 -0
- package/docs/reference/functions/tenantById.md +31 -0
- package/docs/reference/functions/tenantByPublicOrigin.md +31 -0
- package/docs/reference/functions/tenantCreate.md +37 -0
- package/docs/reference/functions/tenantList.md +31 -0
- package/docs/reference/functions/tenantRemove.md +31 -0
- package/docs/reference/functions/tenantUpdate.md +31 -0
- package/docs/reference/index.md +47 -0
- package/docs/reference/interfaces/ISingleTenantProcessorConfig.md +11 -0
- package/docs/reference/interfaces/ISingleTenantProcessorConstructorOptions.md +11 -0
- package/docs/reference/interfaces/ITenantAdminServiceConfig.md +49 -0
- package/docs/reference/interfaces/ITenantAdminServiceConstructorOptions.md +25 -0
- package/docs/reference/interfaces/ITenantCreateRequest.md +17 -0
- package/docs/reference/interfaces/ITenantGetByApiKeyRequest.md +17 -0
- package/docs/reference/interfaces/ITenantGetByIdRequest.md +17 -0
- package/docs/reference/interfaces/ITenantGetByPublicOriginRequest.md +17 -0
- package/docs/reference/interfaces/ITenantGetResponse.md +11 -0
- package/docs/reference/interfaces/ITenantListRequest.md +36 -0
- package/docs/reference/interfaces/ITenantListResponse.md +23 -0
- package/docs/reference/interfaces/ITenantOverrideProcessorConfig.md +19 -0
- package/docs/reference/interfaces/ITenantOverrideProcessorConstructorOptions.md +25 -0
- package/docs/reference/interfaces/ITenantProcessorConfig.md +33 -0
- package/docs/reference/interfaces/ITenantProcessorConstructorOptions.md +25 -0
- package/docs/reference/interfaces/ITenantRemoveRequest.md +17 -0
- package/docs/reference/interfaces/ITenantUpdateRequest.md +25 -0
- package/docs/reference/variables/tagsTenants.md +5 -0
- package/locales/en.json +24 -0
- package/package.json +57 -5
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Class: TenantIdContextIdHandler
|
|
2
|
+
|
|
3
|
+
Context ID handler that treats a tenant ID as a compact base64url-encoded hex string.
|
|
4
|
+
|
|
5
|
+
## Implements
|
|
6
|
+
|
|
7
|
+
- `IContextIdHandler`
|
|
8
|
+
|
|
9
|
+
## Constructors
|
|
10
|
+
|
|
11
|
+
### Constructor
|
|
12
|
+
|
|
13
|
+
> **new TenantIdContextIdHandler**(): `TenantIdContextIdHandler`
|
|
14
|
+
|
|
15
|
+
#### Returns
|
|
16
|
+
|
|
17
|
+
`TenantIdContextIdHandler`
|
|
18
|
+
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
### CLASS\_NAME {#class_name}
|
|
22
|
+
|
|
23
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
24
|
+
|
|
25
|
+
Runtime name for the class.
|
|
26
|
+
|
|
27
|
+
## Methods
|
|
28
|
+
|
|
29
|
+
### className() {#classname}
|
|
30
|
+
|
|
31
|
+
> **className**(): `string`
|
|
32
|
+
|
|
33
|
+
The class name of the component.
|
|
34
|
+
|
|
35
|
+
#### Returns
|
|
36
|
+
|
|
37
|
+
`string`
|
|
38
|
+
|
|
39
|
+
The class name.
|
|
40
|
+
|
|
41
|
+
#### Implementation of
|
|
42
|
+
|
|
43
|
+
`IContextIdHandler.className`
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
### short() {#short}
|
|
48
|
+
|
|
49
|
+
> **short**(`value`): `string`
|
|
50
|
+
|
|
51
|
+
The short form of the tenant id is the base64 version to compact.
|
|
52
|
+
|
|
53
|
+
#### Parameters
|
|
54
|
+
|
|
55
|
+
##### value
|
|
56
|
+
|
|
57
|
+
`string`
|
|
58
|
+
|
|
59
|
+
The full context id value.
|
|
60
|
+
|
|
61
|
+
#### Returns
|
|
62
|
+
|
|
63
|
+
`string`
|
|
64
|
+
|
|
65
|
+
Short form string.
|
|
66
|
+
|
|
67
|
+
#### Implementation of
|
|
68
|
+
|
|
69
|
+
`IContextIdHandler.short`
|
|
70
|
+
|
|
71
|
+
***
|
|
72
|
+
|
|
73
|
+
### long() {#long}
|
|
74
|
+
|
|
75
|
+
> **long**(`value`): `string`
|
|
76
|
+
|
|
77
|
+
The long form version of the context ID, expanded from a short version.
|
|
78
|
+
|
|
79
|
+
#### Parameters
|
|
80
|
+
|
|
81
|
+
##### value
|
|
82
|
+
|
|
83
|
+
`string`
|
|
84
|
+
|
|
85
|
+
The short form context ID value.
|
|
86
|
+
|
|
87
|
+
#### Returns
|
|
88
|
+
|
|
89
|
+
`string`
|
|
90
|
+
|
|
91
|
+
The long form version of the context ID.
|
|
92
|
+
|
|
93
|
+
#### Implementation of
|
|
94
|
+
|
|
95
|
+
`IContextIdHandler.long`
|
|
96
|
+
|
|
97
|
+
***
|
|
98
|
+
|
|
99
|
+
### guard() {#guard}
|
|
100
|
+
|
|
101
|
+
> **guard**(`value`): `void`
|
|
102
|
+
|
|
103
|
+
Guard the value ensuring length.
|
|
104
|
+
|
|
105
|
+
#### Parameters
|
|
106
|
+
|
|
107
|
+
##### value
|
|
108
|
+
|
|
109
|
+
`string`
|
|
110
|
+
|
|
111
|
+
The value to guard.
|
|
112
|
+
|
|
113
|
+
#### Returns
|
|
114
|
+
|
|
115
|
+
`void`
|
|
116
|
+
|
|
117
|
+
#### Throws
|
|
118
|
+
|
|
119
|
+
GeneralError if the value is too short.
|
|
120
|
+
|
|
121
|
+
#### Implementation of
|
|
122
|
+
|
|
123
|
+
`IContextIdHandler.guard`
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Class: TenantIdHelper
|
|
2
|
+
|
|
3
|
+
Helper class for tenant id related operations.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### Constructor
|
|
8
|
+
|
|
9
|
+
> **new TenantIdHelper**(): `TenantIdHelper`
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
`TenantIdHelper`
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
### generateTenantId() {#generatetenantid}
|
|
18
|
+
|
|
19
|
+
> `static` **generateTenantId**(): `string`
|
|
20
|
+
|
|
21
|
+
Generates a new tenant ID.
|
|
22
|
+
|
|
23
|
+
#### Returns
|
|
24
|
+
|
|
25
|
+
`string`
|
|
26
|
+
|
|
27
|
+
A new tenant ID.
|
|
28
|
+
|
|
29
|
+
***
|
|
30
|
+
|
|
31
|
+
### generateApiKey() {#generateapikey}
|
|
32
|
+
|
|
33
|
+
> `static` **generateApiKey**(): `string`
|
|
34
|
+
|
|
35
|
+
Generates a new API Key.
|
|
36
|
+
|
|
37
|
+
#### Returns
|
|
38
|
+
|
|
39
|
+
`string`
|
|
40
|
+
|
|
41
|
+
A new API Key.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Class: TenantOverrideProcessor
|
|
2
|
+
|
|
3
|
+
Processes the overrideTenant query parameter for routes that allow tenant override.
|
|
4
|
+
Requires the caller to hold the escalated privilege scope. Runs after AuthHeaderProcessor so
|
|
5
|
+
authentication is always resolved in the caller's own partition first.
|
|
6
|
+
|
|
7
|
+
## Implements
|
|
8
|
+
|
|
9
|
+
- `IBaseRouteProcessor`
|
|
10
|
+
|
|
11
|
+
## Constructors
|
|
12
|
+
|
|
13
|
+
### Constructor
|
|
14
|
+
|
|
15
|
+
> **new TenantOverrideProcessor**(`options?`): `TenantOverrideProcessor`
|
|
16
|
+
|
|
17
|
+
Create a new instance of TenantOverrideProcessor.
|
|
18
|
+
|
|
19
|
+
#### Parameters
|
|
20
|
+
|
|
21
|
+
##### options?
|
|
22
|
+
|
|
23
|
+
[`ITenantOverrideProcessorConstructorOptions`](../interfaces/ITenantOverrideProcessorConstructorOptions.md)
|
|
24
|
+
|
|
25
|
+
Options for the processor.
|
|
26
|
+
|
|
27
|
+
#### Returns
|
|
28
|
+
|
|
29
|
+
`TenantOverrideProcessor`
|
|
30
|
+
|
|
31
|
+
## Properties
|
|
32
|
+
|
|
33
|
+
### OVERRIDE\_TENANT\_PARAM {#override_tenant_param}
|
|
34
|
+
|
|
35
|
+
> `readonly` `static` **OVERRIDE\_TENANT\_PARAM**: `string` = `"override-tenant"`
|
|
36
|
+
|
|
37
|
+
The query parameter name used to supply the override tenant ID.
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
41
|
+
### DEFAULT\_ESCALATED\_PRIVILEGE\_SCOPE {#default_escalated_privilege_scope}
|
|
42
|
+
|
|
43
|
+
> `readonly` `static` **DEFAULT\_ESCALATED\_PRIVILEGE\_SCOPE**: `string` = `"global-admin"`
|
|
44
|
+
|
|
45
|
+
The scope string required to perform a tenant override.
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### CLASS\_NAME {#class_name}
|
|
50
|
+
|
|
51
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
52
|
+
|
|
53
|
+
Runtime name for the class.
|
|
54
|
+
|
|
55
|
+
## Methods
|
|
56
|
+
|
|
57
|
+
### className() {#classname}
|
|
58
|
+
|
|
59
|
+
> **className**(): `string`
|
|
60
|
+
|
|
61
|
+
Returns the class name of the component.
|
|
62
|
+
|
|
63
|
+
#### Returns
|
|
64
|
+
|
|
65
|
+
`string`
|
|
66
|
+
|
|
67
|
+
The class name of the component.
|
|
68
|
+
|
|
69
|
+
#### Implementation of
|
|
70
|
+
|
|
71
|
+
`IBaseRouteProcessor.className`
|
|
72
|
+
|
|
73
|
+
***
|
|
74
|
+
|
|
75
|
+
### pre() {#pre}
|
|
76
|
+
|
|
77
|
+
> **pre**(`request`, `response`, `route`, `contextIds`, `processorState`): `Promise`\<`void`\>
|
|
78
|
+
|
|
79
|
+
Pre process the REST request for the specified route.
|
|
80
|
+
|
|
81
|
+
#### Parameters
|
|
82
|
+
|
|
83
|
+
##### request
|
|
84
|
+
|
|
85
|
+
`IHttpServerRequest`
|
|
86
|
+
|
|
87
|
+
The incoming request.
|
|
88
|
+
|
|
89
|
+
##### response
|
|
90
|
+
|
|
91
|
+
`IHttpResponse`
|
|
92
|
+
|
|
93
|
+
The outgoing response.
|
|
94
|
+
|
|
95
|
+
##### route
|
|
96
|
+
|
|
97
|
+
`IBaseRoute` \| `undefined`
|
|
98
|
+
|
|
99
|
+
The route to process.
|
|
100
|
+
|
|
101
|
+
##### contextIds
|
|
102
|
+
|
|
103
|
+
`IContextIds`
|
|
104
|
+
|
|
105
|
+
The context IDs of the request.
|
|
106
|
+
|
|
107
|
+
##### processorState
|
|
108
|
+
|
|
109
|
+
The state handed through the processors.
|
|
110
|
+
|
|
111
|
+
#### Returns
|
|
112
|
+
|
|
113
|
+
`Promise`\<`void`\>
|
|
114
|
+
|
|
115
|
+
A promise that resolves when the tenant override has been applied or skipped.
|
|
116
|
+
|
|
117
|
+
#### Implementation of
|
|
118
|
+
|
|
119
|
+
`IBaseRouteProcessor.pre`
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Class: TenantProcessor
|
|
2
|
+
|
|
3
|
+
Handles incoming api keys and maps them to tenant ids.
|
|
4
|
+
|
|
5
|
+
## Implements
|
|
6
|
+
|
|
7
|
+
- `IBaseRouteProcessor`
|
|
8
|
+
|
|
9
|
+
## Constructors
|
|
10
|
+
|
|
11
|
+
### Constructor
|
|
12
|
+
|
|
13
|
+
> **new TenantProcessor**(`options?`): `TenantProcessor`
|
|
14
|
+
|
|
15
|
+
Create a new instance of TenantProcessor.
|
|
16
|
+
|
|
17
|
+
#### Parameters
|
|
18
|
+
|
|
19
|
+
##### options?
|
|
20
|
+
|
|
21
|
+
[`ITenantProcessorConstructorOptions`](../interfaces/ITenantProcessorConstructorOptions.md)
|
|
22
|
+
|
|
23
|
+
Options for the processor.
|
|
24
|
+
|
|
25
|
+
#### Returns
|
|
26
|
+
|
|
27
|
+
`TenantProcessor`
|
|
28
|
+
|
|
29
|
+
## Properties
|
|
30
|
+
|
|
31
|
+
### CLASS\_NAME {#class_name}
|
|
32
|
+
|
|
33
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
34
|
+
|
|
35
|
+
Runtime name for the class.
|
|
36
|
+
|
|
37
|
+
## Methods
|
|
38
|
+
|
|
39
|
+
### className() {#classname}
|
|
40
|
+
|
|
41
|
+
> **className**(): `string`
|
|
42
|
+
|
|
43
|
+
Returns the class name of the component.
|
|
44
|
+
|
|
45
|
+
#### Returns
|
|
46
|
+
|
|
47
|
+
`string`
|
|
48
|
+
|
|
49
|
+
The class name of the component.
|
|
50
|
+
|
|
51
|
+
#### Implementation of
|
|
52
|
+
|
|
53
|
+
`IBaseRouteProcessor.className`
|
|
54
|
+
|
|
55
|
+
***
|
|
56
|
+
|
|
57
|
+
### pre() {#pre}
|
|
58
|
+
|
|
59
|
+
> **pre**(`request`, `response`, `route`, `contextIds`, `processorState`): `Promise`\<`void`\>
|
|
60
|
+
|
|
61
|
+
Pre process the REST request for the specified route.
|
|
62
|
+
|
|
63
|
+
#### Parameters
|
|
64
|
+
|
|
65
|
+
##### request
|
|
66
|
+
|
|
67
|
+
`IHttpServerRequest`
|
|
68
|
+
|
|
69
|
+
The incoming request.
|
|
70
|
+
|
|
71
|
+
##### response
|
|
72
|
+
|
|
73
|
+
`IHttpResponse`
|
|
74
|
+
|
|
75
|
+
The outgoing response.
|
|
76
|
+
|
|
77
|
+
##### route
|
|
78
|
+
|
|
79
|
+
`IBaseRoute` \| `undefined`
|
|
80
|
+
|
|
81
|
+
The route to process.
|
|
82
|
+
|
|
83
|
+
##### contextIds
|
|
84
|
+
|
|
85
|
+
`IContextIds`
|
|
86
|
+
|
|
87
|
+
The context IDs of the request.
|
|
88
|
+
|
|
89
|
+
##### processorState
|
|
90
|
+
|
|
91
|
+
The state handed through the processors.
|
|
92
|
+
|
|
93
|
+
#### Returns
|
|
94
|
+
|
|
95
|
+
`Promise`\<`void`\>
|
|
96
|
+
|
|
97
|
+
A promise that resolves when the tenant context has been resolved and injected, or an error response set.
|
|
98
|
+
|
|
99
|
+
#### Implementation of
|
|
100
|
+
|
|
101
|
+
`IBaseRouteProcessor.pre`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Function: generateRestRoutesTenants()
|
|
2
|
+
|
|
3
|
+
> **generateRestRoutesTenants**(`baseRouteName`, `componentName`): `IRestRoute`\<`any`, `any`\>[]
|
|
4
|
+
|
|
5
|
+
The REST routes for tenant management.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### baseRouteName
|
|
10
|
+
|
|
11
|
+
`string`
|
|
12
|
+
|
|
13
|
+
Prefix to prepend to the paths.
|
|
14
|
+
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
The name of the component to use in the routes stored in the ComponentFactory.
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`IRestRoute`\<`any`, `any`\>[]
|
|
24
|
+
|
|
25
|
+
The generated routes.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Function: initSchema()
|
|
2
|
+
|
|
3
|
+
> **initSchema**(): `void`
|
|
4
|
+
|
|
5
|
+
Initialize the schema for the node tenant processor, including the Tenant 1 to 2 migration
|
|
6
|
+
step which converts organizationIdLegacy from a pipe-delimited string to an array of ids.
|
|
7
|
+
|
|
8
|
+
## Returns
|
|
9
|
+
|
|
10
|
+
`void`
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: tenantByApiKey()
|
|
2
|
+
|
|
3
|
+
> **tenantByApiKey**(`httpRequestContext`, `componentName`, `request`): `Promise`\<[`ITenantGetResponse`](../interfaces/ITenantGetResponse.md)\>
|
|
4
|
+
|
|
5
|
+
Get the tenant by api key.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
12
|
+
|
|
13
|
+
The request context for the API.
|
|
14
|
+
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
The name of the component to use in the routes.
|
|
20
|
+
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
[`ITenantGetByApiKeyRequest`](../interfaces/ITenantGetByApiKeyRequest.md)
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<[`ITenantGetResponse`](../interfaces/ITenantGetResponse.md)\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: tenantById()
|
|
2
|
+
|
|
3
|
+
> **tenantById**(`httpRequestContext`, `componentName`, `request`): `Promise`\<[`ITenantGetResponse`](../interfaces/ITenantGetResponse.md)\>
|
|
4
|
+
|
|
5
|
+
Get the tenant by id.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
12
|
+
|
|
13
|
+
The request context for the API.
|
|
14
|
+
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
The name of the component to use in the routes.
|
|
20
|
+
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
[`ITenantGetByIdRequest`](../interfaces/ITenantGetByIdRequest.md)
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<[`ITenantGetResponse`](../interfaces/ITenantGetResponse.md)\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: tenantByPublicOrigin()
|
|
2
|
+
|
|
3
|
+
> **tenantByPublicOrigin**(`httpRequestContext`, `componentName`, `request`): `Promise`\<[`ITenantGetResponse`](../interfaces/ITenantGetResponse.md)\>
|
|
4
|
+
|
|
5
|
+
Get the tenant by public origin.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
12
|
+
|
|
13
|
+
The request context for the API.
|
|
14
|
+
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
The name of the component to use in the routes.
|
|
20
|
+
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
[`ITenantGetByPublicOriginRequest`](../interfaces/ITenantGetByPublicOriginRequest.md)
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<[`ITenantGetResponse`](../interfaces/ITenantGetResponse.md)\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Function: tenantCreate()
|
|
2
|
+
|
|
3
|
+
> **tenantCreate**(`httpRequestContext`, `componentName`, `request`, `baseRouteName`): `Promise`\<`ICreatedResponse`\>
|
|
4
|
+
|
|
5
|
+
Create the tenant.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
12
|
+
|
|
13
|
+
The request context for the API.
|
|
14
|
+
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
The name of the component to use in the routes.
|
|
20
|
+
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
[`ITenantCreateRequest`](../interfaces/ITenantCreateRequest.md)
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
### baseRouteName
|
|
28
|
+
|
|
29
|
+
`string`
|
|
30
|
+
|
|
31
|
+
The base route name for the tenant.
|
|
32
|
+
|
|
33
|
+
## Returns
|
|
34
|
+
|
|
35
|
+
`Promise`\<`ICreatedResponse`\>
|
|
36
|
+
|
|
37
|
+
The response object with additional http response properties.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: tenantList()
|
|
2
|
+
|
|
3
|
+
> **tenantList**(`httpRequestContext`, `componentName`, `request`): `Promise`\<[`ITenantListResponse`](../interfaces/ITenantListResponse.md)\>
|
|
4
|
+
|
|
5
|
+
Get the list of tenants.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
12
|
+
|
|
13
|
+
The request context for the API.
|
|
14
|
+
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
The name of the component to use in the routes.
|
|
20
|
+
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
[`ITenantListRequest`](../interfaces/ITenantListRequest.md)
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<[`ITenantListResponse`](../interfaces/ITenantListResponse.md)\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: tenantRemove()
|
|
2
|
+
|
|
3
|
+
> **tenantRemove**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
|
|
4
|
+
|
|
5
|
+
Remove the tenant by id.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
12
|
+
|
|
13
|
+
The request context for the API.
|
|
14
|
+
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
The name of the component to use in the routes.
|
|
20
|
+
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
[`ITenantRemoveRequest`](../interfaces/ITenantRemoveRequest.md)
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`INoContentResponse`\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: tenantUpdate()
|
|
2
|
+
|
|
3
|
+
> **tenantUpdate**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
|
|
4
|
+
|
|
5
|
+
Update the tenant.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
12
|
+
|
|
13
|
+
The request context for the API.
|
|
14
|
+
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
The name of the component to use in the routes.
|
|
20
|
+
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
[`ITenantUpdateRequest`](../interfaces/ITenantUpdateRequest.md)
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`INoContentResponse`\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @3sixty/api-tenant-processor
|
|
2
|
+
|
|
3
|
+
## Classes
|
|
4
|
+
|
|
5
|
+
- [Tenant](classes/Tenant.md)
|
|
6
|
+
- [SingleTenantProcessor](classes/SingleTenantProcessor.md)
|
|
7
|
+
- [TenantAdminService](classes/TenantAdminService.md)
|
|
8
|
+
- [TenantIdContextIdHandler](classes/TenantIdContextIdHandler.md)
|
|
9
|
+
- [TenantOverrideProcessor](classes/TenantOverrideProcessor.md)
|
|
10
|
+
- [TenantProcessor](classes/TenantProcessor.md)
|
|
11
|
+
- [TenantIdHelper](classes/TenantIdHelper.md)
|
|
12
|
+
|
|
13
|
+
## Interfaces
|
|
14
|
+
|
|
15
|
+
- [ISingleTenantProcessorConfig](interfaces/ISingleTenantProcessorConfig.md)
|
|
16
|
+
- [ISingleTenantProcessorConstructorOptions](interfaces/ISingleTenantProcessorConstructorOptions.md)
|
|
17
|
+
- [ITenantAdminServiceConfig](interfaces/ITenantAdminServiceConfig.md)
|
|
18
|
+
- [ITenantAdminServiceConstructorOptions](interfaces/ITenantAdminServiceConstructorOptions.md)
|
|
19
|
+
- [ITenantOverrideProcessorConfig](interfaces/ITenantOverrideProcessorConfig.md)
|
|
20
|
+
- [ITenantOverrideProcessorConstructorOptions](interfaces/ITenantOverrideProcessorConstructorOptions.md)
|
|
21
|
+
- [ITenantProcessorConfig](interfaces/ITenantProcessorConfig.md)
|
|
22
|
+
- [ITenantProcessorConstructorOptions](interfaces/ITenantProcessorConstructorOptions.md)
|
|
23
|
+
- [ITenantCreateRequest](interfaces/ITenantCreateRequest.md)
|
|
24
|
+
- [ITenantGetByApiKeyRequest](interfaces/ITenantGetByApiKeyRequest.md)
|
|
25
|
+
- [ITenantGetByIdRequest](interfaces/ITenantGetByIdRequest.md)
|
|
26
|
+
- [ITenantGetByPublicOriginRequest](interfaces/ITenantGetByPublicOriginRequest.md)
|
|
27
|
+
- [ITenantGetResponse](interfaces/ITenantGetResponse.md)
|
|
28
|
+
- [ITenantListRequest](interfaces/ITenantListRequest.md)
|
|
29
|
+
- [ITenantListResponse](interfaces/ITenantListResponse.md)
|
|
30
|
+
- [ITenantRemoveRequest](interfaces/ITenantRemoveRequest.md)
|
|
31
|
+
- [ITenantUpdateRequest](interfaces/ITenantUpdateRequest.md)
|
|
32
|
+
|
|
33
|
+
## Variables
|
|
34
|
+
|
|
35
|
+
- [tagsTenants](variables/tagsTenants.md)
|
|
36
|
+
|
|
37
|
+
## Functions
|
|
38
|
+
|
|
39
|
+
- [initSchema](functions/initSchema.md)
|
|
40
|
+
- [generateRestRoutesTenants](functions/generateRestRoutesTenants.md)
|
|
41
|
+
- [tenantList](functions/tenantList.md)
|
|
42
|
+
- [tenantById](functions/tenantById.md)
|
|
43
|
+
- [tenantByApiKey](functions/tenantByApiKey.md)
|
|
44
|
+
- [tenantByPublicOrigin](functions/tenantByPublicOrigin.md)
|
|
45
|
+
- [tenantRemove](functions/tenantRemove.md)
|
|
46
|
+
- [tenantCreate](functions/tenantCreate.md)
|
|
47
|
+
- [tenantUpdate](functions/tenantUpdate.md)
|