@afora/core 0.0.7 → 0.0.9
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 +157 -25
- package/dist/adapters.d.ts +25 -0
- package/dist/adapters.js +56 -0
- package/dist/core/application/exceptions.d.ts +17 -0
- package/dist/core/application/migrate.d.ts +19 -0
- package/dist/core/application/schema.d.ts +30 -0
- package/dist/core/application/start.d.ts +7 -0
- package/dist/core/application/types/application.interface.d.ts +73 -2
- package/dist/core/auth/jwt.d.ts +30 -0
- package/dist/core/auth/types/jwt.interface.d.ts +66 -0
- package/dist/core/blueprint/exceptions.d.ts +5 -0
- package/dist/core/blueprint/optional.d.ts +3 -1
- package/dist/core/blueprint/types/blueprint.interface.d.ts +79 -5
- package/dist/core/blueprint/variant.d.ts +32 -0
- package/dist/core/command/types/command.interface.d.ts +7 -0
- package/dist/core/entity/abstract-entity.d.ts +33 -1
- package/dist/core/entity/entity.d.ts +1 -1
- package/dist/core/entity/event.d.ts +13 -2
- package/dist/core/entity/exceptions.d.ts +17 -0
- package/dist/core/entity/trust.d.ts +24 -0
- package/dist/core/entity/types/entity.interface.d.ts +96 -2
- package/dist/core/entity/version.d.ts +13 -0
- package/dist/core/event-policy/event-policy.d.ts +25 -0
- package/dist/core/event-policy/exceptions.d.ts +11 -0
- package/dist/core/event-policy/publish.d.ts +17 -0
- package/dist/core/event-policy/publishers.d.ts +18 -0
- package/dist/core/event-policy/types/event-policy.interface.d.ts +72 -0
- package/dist/core/output/access.d.ts +16 -0
- package/dist/core/output/coerce.d.ts +9 -0
- package/dist/core/output/exceptions.d.ts +16 -0
- package/dist/core/output/http.d.ts +36 -0
- package/dist/core/output/openapi-sink.d.ts +160 -39
- package/dist/core/output/stage.d.ts +7 -2
- package/dist/core/output/status.d.ts +2 -2
- package/dist/core/output/types/http.interface.d.ts +130 -0
- package/dist/core/output/types/output.interface.d.ts +25 -5
- package/dist/core/parse/issue.d.ts +28 -3
- package/dist/core/parse/parse.d.ts +19 -0
- package/dist/core/parse/strip.d.ts +13 -0
- package/dist/core/property/abstract-property.d.ts +9 -0
- package/dist/core/property/define-property.d.ts +34 -6
- package/dist/core/property/types/property-options.interface.d.ts +10 -0
- package/dist/core/property/types/property-type.interface.d.ts +4 -0
- package/dist/core/record/abstract-record.d.ts +7 -0
- package/dist/core/record/types/record.interface.d.ts +12 -1
- package/dist/core/repository/exceptions.d.ts +43 -0
- package/dist/core/repository/in-memory.d.ts +16 -3
- package/dist/core/repository/migrate.d.ts +20 -0
- package/dist/core/repository/plan.d.ts +20 -0
- package/dist/core/repository/provider.d.ts +1 -1
- package/dist/core/repository/query.d.ts +9 -2
- package/dist/core/repository/repository.d.ts +40 -8
- package/dist/core/repository/state.d.ts +32 -2
- package/dist/core/repository/types/query.interface.d.ts +106 -5
- package/dist/core/repository/types/repository.interface.d.ts +139 -7
- package/dist/core/repository/types/schema.interface.d.ts +126 -0
- package/dist/core/repository/upcast.d.ts +64 -0
- package/dist/core/schema/schema.d.ts +28 -0
- package/dist/core/symbols/kind.d.ts +1 -1
- package/dist/core/use-case/access.d.ts +12 -0
- package/dist/core/use-case/decorators.d.ts +40 -0
- package/dist/core/use-case/route.d.ts +18 -0
- package/dist/core/use-case/steps/types/check.interface.d.ts +214 -0
- package/dist/core/use-case/types/access.interface.d.ts +39 -0
- package/dist/core/use-case/types/route.interface.d.ts +66 -0
- package/dist/core/use-case/use-case.d.ts +52 -2
- package/dist/experimental.d.ts +13 -1
- package/dist/experimental.js +64 -26
- package/dist/index-3aae5jfq.js +2997 -0
- package/dist/index-hg1z2s2v.js +1055 -0
- package/dist/index-ny3as79r.js +4567 -0
- package/dist/index-xegv6a1p.js +4291 -0
- package/dist/index-y280ew0k.js +396 -0
- package/dist/index.d.ts +55 -48
- package/dist/index.js +141 -169
- package/dist/std/blueprint-plugin.d.ts +6 -2
- package/dist/std/blueprint.d.ts +3 -0
- package/dist/std/entity.d.ts +2 -1
- package/dist/std/event-policies.d.ts +2 -0
- package/dist/std/properties/exceptions.d.ts +11 -0
- package/dist/std/properties/json.d.ts +54 -0
- package/dist/std/properties/password.d.ts +0 -2
- package/dist/std/properties/time.d.ts +4 -0
- package/dist/std/record-plugins.d.ts +2 -2
- package/dist/std/resource.d.ts +31 -0
- package/dist/std/runtime.d.ts +6 -0
- package/dist/std/use-cases/auth.d.ts +5 -1
- package/dist/std/use-cases/crud.d.ts +6 -4
- package/dist/std/use-cases/index.d.ts +1 -1
- package/dist/std/use-cases/shared.d.ts +34 -6
- package/dist/std/use-cases/types.d.ts +197 -22
- package/dist/testing/http-provider-contract.d.ts +32 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.js +839 -3
- package/dist/testing/memory-publisher.d.ts +16 -0
- package/dist/testing/provider-contract.d.ts +31 -1
- package/package.json +17 -3
- package/dist/index-q6hggpzw.js +0 -6667
- package/dist/index-r78dsvtc.js +0 -1721
package/dist/index.js
CHANGED
|
@@ -1,73 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
InvalidEnvironment2,
|
|
3
|
-
environmentOf2,
|
|
4
|
-
isEnvironment2,
|
|
5
|
-
guard2,
|
|
6
|
-
InvalidApplicationDeclaration2,
|
|
7
|
-
DuplicateApplicationDeclaration2,
|
|
8
|
-
ApplicationConflict2,
|
|
9
|
-
UnregisteredApplicationReference2,
|
|
10
|
-
UnregisteredRepositoryDependency2,
|
|
11
|
-
UnregisteredUseCaseDependency2,
|
|
12
|
-
ApplicationNotStarted2,
|
|
13
|
-
ProviderNotBound2,
|
|
14
|
-
ApplicationAlreadyStarted2,
|
|
15
|
-
InvalidApplicationEnvironment2,
|
|
16
|
-
useApplication2,
|
|
17
|
-
resetApplication2,
|
|
18
|
-
InvalidLogDeclaration2,
|
|
19
|
-
LogLevels2,
|
|
20
|
-
logProviderOf2,
|
|
21
|
-
consoleLogProvider2,
|
|
22
|
-
jsonLogProvider2,
|
|
23
|
-
memoryLogProvider2,
|
|
24
|
-
Logger2,
|
|
25
|
-
ReservedEntityKey2,
|
|
26
|
-
ImmutableEntityKey2,
|
|
27
|
-
DeletedEntity2,
|
|
28
|
-
entityBuilderOf2,
|
|
29
|
-
isEntityClass2,
|
|
30
|
-
isEntity2,
|
|
31
|
-
eventOf2,
|
|
32
|
-
ENTITY_IDENTITY_KEYS2,
|
|
33
|
-
RESERVED_ENTITY_KEYS2,
|
|
34
|
-
EntityUniqueKeys2,
|
|
35
|
-
AbstractEntity2,
|
|
36
|
-
InvalidRepositoryQuery2,
|
|
37
|
-
InvalidRepositoryCursor2,
|
|
38
|
-
InvalidRepositoryDeclaration2,
|
|
39
|
-
InvalidRepositoryEntity2,
|
|
40
|
-
InvalidRepositoryData2,
|
|
41
|
-
RepositoryUniqueViolation2,
|
|
42
|
-
RepositoryEntityNotFound2,
|
|
43
|
-
providerOf2,
|
|
44
|
-
providerDescriptionOf2,
|
|
45
|
-
inMemoryProvider2,
|
|
46
|
-
AbstractRepository2,
|
|
47
|
-
repositoryOf2,
|
|
48
|
-
RepositoryOf2,
|
|
49
|
-
isRepository2,
|
|
50
|
-
InvalidUseCaseStep2,
|
|
51
|
-
InvalidUseCasePlugin2,
|
|
52
|
-
UnknownUseCasePlugin2,
|
|
53
|
-
IncompatibleUseCasePlugin2,
|
|
54
|
-
UseCaseUnavailable2,
|
|
55
|
-
UseCaseEntityNotFound2,
|
|
56
|
-
UseCaseEntityConflict2,
|
|
57
|
-
UseCaseInvalidCredentials2,
|
|
58
|
-
PropertyInput2,
|
|
59
|
-
propertyInputOf2,
|
|
60
|
-
useCaseTargetOf2,
|
|
61
|
-
InvalidUseCaseDeclaration2,
|
|
62
|
-
UseCaseAlreadyExecuted2,
|
|
63
|
-
InvalidUseCaseDependencies2,
|
|
64
|
-
AbstractUseCase2,
|
|
65
|
-
useCaseOf2,
|
|
66
|
-
isUseCaseClass2,
|
|
67
|
-
isUseCase2,
|
|
68
|
-
isUseCasePlugin2,
|
|
69
|
-
useCaseOriginOf2,
|
|
70
|
-
useCasePluginOf2,
|
|
71
2
|
isUseCaseCatalog2,
|
|
72
3
|
useCaseCatalogOf2,
|
|
73
4
|
InvalidCommandDeclaration2,
|
|
@@ -77,37 +8,21 @@ import {
|
|
|
77
8
|
CommandEventFailed2,
|
|
78
9
|
commandBuilderOf2,
|
|
79
10
|
isCommand2,
|
|
80
|
-
InvalidOpenAPIModel2,
|
|
81
|
-
InvalidOutputStage2,
|
|
82
|
-
DuplicateOperation2,
|
|
83
|
-
toOpenAPI2,
|
|
84
|
-
transformOf2,
|
|
85
|
-
sinkOf2,
|
|
86
|
-
stageDescriptionOf2,
|
|
87
|
-
stageKindOf2,
|
|
88
|
-
stageCatalogOf2,
|
|
89
11
|
operationOf2,
|
|
90
12
|
outputOf2,
|
|
91
13
|
isOutput2,
|
|
92
14
|
providerFrom2,
|
|
93
15
|
logFrom2,
|
|
94
|
-
isLogFactory2,
|
|
95
16
|
isProviderFactory2,
|
|
96
17
|
providersOf2,
|
|
97
|
-
isProviderSlot2,
|
|
98
|
-
isProviderStorage2,
|
|
99
|
-
isApplication2,
|
|
100
18
|
applicationOf2,
|
|
101
19
|
blueprintPluginOf2,
|
|
102
|
-
|
|
103
|
-
PROBLEM_MEDIA_TYPE2,
|
|
104
|
-
problemOf2,
|
|
105
|
-
outputValueOf2,
|
|
106
|
-
routeOptionsIssue2,
|
|
107
|
-
operationRoutes2,
|
|
108
|
-
openapi2,
|
|
20
|
+
publishEvents2,
|
|
109
21
|
select2,
|
|
22
|
+
stripUndeclared2,
|
|
110
23
|
recordPluginCatalogOf2,
|
|
24
|
+
Route2,
|
|
25
|
+
Access2,
|
|
111
26
|
Email2,
|
|
112
27
|
Phone2,
|
|
113
28
|
Url2,
|
|
@@ -120,11 +35,12 @@ import {
|
|
|
120
35
|
resetRuntime2,
|
|
121
36
|
Id2,
|
|
122
37
|
Slug2,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
38
|
+
InvalidJsonData2,
|
|
39
|
+
InvalidJsonSchema2,
|
|
40
|
+
jsonSchemaIssues2,
|
|
41
|
+
checkJsonSchema2,
|
|
42
|
+
JsonProperty2,
|
|
43
|
+
jsonOf2,
|
|
128
44
|
PlainPassword2,
|
|
129
45
|
Password2,
|
|
130
46
|
StringProperty2,
|
|
@@ -137,6 +53,7 @@ import {
|
|
|
137
53
|
CreatedAt2,
|
|
138
54
|
UpdatedAt2,
|
|
139
55
|
DeletedAt2,
|
|
56
|
+
ExpiresAt2,
|
|
140
57
|
Std2,
|
|
141
58
|
blueprintOf2,
|
|
142
59
|
StdUseCases2,
|
|
@@ -148,26 +65,78 @@ import {
|
|
|
148
65
|
Authenticatable2,
|
|
149
66
|
StdRecordPlugins2,
|
|
150
67
|
entityOf2,
|
|
68
|
+
StdEventPolicies2,
|
|
151
69
|
recordOf2,
|
|
70
|
+
resourceOf2,
|
|
152
71
|
StdStages2
|
|
153
|
-
} from "./index-
|
|
72
|
+
} from "./index-ny3as79r.js";
|
|
73
|
+
import {
|
|
74
|
+
openapi2
|
|
75
|
+
} from "./index-hg1z2s2v.js";
|
|
76
|
+
import {
|
|
77
|
+
InvalidEventPolicy2,
|
|
78
|
+
PublisherNotBound2,
|
|
79
|
+
guard2,
|
|
80
|
+
providerOf2,
|
|
81
|
+
inMemoryProvider2,
|
|
82
|
+
repositoryOf2,
|
|
83
|
+
RepositoryOf2,
|
|
84
|
+
InvalidUseCaseStep2,
|
|
85
|
+
InvalidUseCasePlugin2,
|
|
86
|
+
UnknownUseCasePlugin2,
|
|
87
|
+
IncompatibleUseCasePlugin2,
|
|
88
|
+
UseCaseUnavailable2,
|
|
89
|
+
UseCaseEntityNotFound2,
|
|
90
|
+
UseCaseEntityConflict2,
|
|
91
|
+
UseCaseInvalidCredentials2,
|
|
92
|
+
PropertyInput2,
|
|
93
|
+
propertyInputOf2,
|
|
94
|
+
InvalidUseCaseDeclaration2,
|
|
95
|
+
UseCaseAlreadyExecuted2,
|
|
96
|
+
InvalidUseCaseDependencies2,
|
|
97
|
+
useCaseOf2,
|
|
98
|
+
isUseCaseClass2,
|
|
99
|
+
isUseCase2,
|
|
100
|
+
isUseCasePlugin2,
|
|
101
|
+
useCasePluginOf2,
|
|
102
|
+
eventPolicyOf2
|
|
103
|
+
} from "./index-3aae5jfq.js";
|
|
154
104
|
import {
|
|
155
|
-
isProperty2,
|
|
156
|
-
schemaOf2,
|
|
157
|
-
Demo2,
|
|
158
|
-
propertyLineageOf2,
|
|
159
|
-
Kind2,
|
|
160
|
-
isBlueprint2,
|
|
161
|
-
isRecordClass2,
|
|
162
|
-
isOptionalRecord2,
|
|
163
|
-
recordFieldOf2,
|
|
164
|
-
recordNameOf2,
|
|
165
|
-
listOf2,
|
|
166
|
-
isBlueprintList2,
|
|
167
105
|
ExceptionLayers2,
|
|
168
|
-
UNEXPECTED_ERROR2,
|
|
169
106
|
Exception2,
|
|
170
107
|
exceptionOf2,
|
|
108
|
+
ReservedBlueprintKey2,
|
|
109
|
+
InvalidBlueprintVariant2,
|
|
110
|
+
UndeclaredBlueprintProperty2,
|
|
111
|
+
variantOf2,
|
|
112
|
+
State2,
|
|
113
|
+
PropertyRequired2,
|
|
114
|
+
InvalidPropertyValue2,
|
|
115
|
+
recordNameOf2,
|
|
116
|
+
listOf2,
|
|
117
|
+
InvalidEnvironment2,
|
|
118
|
+
environmentOf2,
|
|
119
|
+
InvalidApplicationDeclaration2,
|
|
120
|
+
DuplicateApplicationDeclaration2,
|
|
121
|
+
ApplicationConflict2,
|
|
122
|
+
UnregisteredApplicationReference2,
|
|
123
|
+
UnregisteredRepositoryDependency2,
|
|
124
|
+
UnregisteredUseCaseDependency2,
|
|
125
|
+
ApplicationNotStarted2,
|
|
126
|
+
ProviderNotBound2,
|
|
127
|
+
ApplicationAlreadyStarted2,
|
|
128
|
+
SchemaLockMismatch2,
|
|
129
|
+
InvalidSchemaMigration2,
|
|
130
|
+
InvalidApplicationEnvironment2,
|
|
131
|
+
useApplication2,
|
|
132
|
+
resetApplication2,
|
|
133
|
+
InvalidLogDeclaration2,
|
|
134
|
+
LogLevels2,
|
|
135
|
+
logProviderOf2,
|
|
136
|
+
consoleLogProvider2,
|
|
137
|
+
jsonLogProvider2,
|
|
138
|
+
memoryLogProvider2,
|
|
139
|
+
Logger2,
|
|
171
140
|
Meta2,
|
|
172
141
|
InvalidRecordValue2,
|
|
173
142
|
InvalidRecordDeclaration2,
|
|
@@ -178,32 +147,46 @@ import {
|
|
|
178
147
|
UnknownRecordPlugin2,
|
|
179
148
|
IncompatibleRecordPlugin2,
|
|
180
149
|
MASK2,
|
|
181
|
-
|
|
182
|
-
|
|
150
|
+
propertyOf2,
|
|
151
|
+
optionalOf2,
|
|
152
|
+
blueprintBuilderOf2,
|
|
183
153
|
pluginsOf2,
|
|
184
|
-
isRecordPlugin2,
|
|
185
154
|
hasPlugin2,
|
|
186
155
|
recordPluginOf2,
|
|
187
156
|
recordBuilderOf2,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
157
|
+
ReservedEntityKey2,
|
|
158
|
+
ImmutableEntityKey2,
|
|
159
|
+
DeletedEntity2,
|
|
160
|
+
InvalidEntityExpiry2,
|
|
161
|
+
InvalidEntitySchemaVersion2,
|
|
162
|
+
EntityVersion2,
|
|
163
|
+
entityBuilderOf2,
|
|
164
|
+
isEntityClass2,
|
|
165
|
+
isEntity2,
|
|
166
|
+
eventOf2,
|
|
167
|
+
EntityUniqueKeys2,
|
|
168
|
+
EntitySettings2,
|
|
169
|
+
InvalidRepositoryQuery2,
|
|
170
|
+
InvalidRepositoryCursor2,
|
|
171
|
+
InvalidRepositoryDeclaration2,
|
|
172
|
+
InvalidRepositoryEntity2,
|
|
173
|
+
InvalidStoredSchemaVersion2,
|
|
174
|
+
InvalidRepositoryData2,
|
|
175
|
+
RepositoryUniqueViolation2,
|
|
176
|
+
RepositoryUsedOutsideApplication2,
|
|
177
|
+
RepositoryEntityNotFound2,
|
|
178
|
+
RepositoryConcurrencyConflict2,
|
|
179
|
+
InvalidRepositoryIncrement2,
|
|
180
|
+
InvalidOpenAPIModel2,
|
|
181
|
+
toOpenAPI2,
|
|
182
|
+
InvalidOutputStage2,
|
|
183
|
+
DuplicateOperation2,
|
|
184
|
+
Unauthenticated2,
|
|
185
|
+
Forbidden2,
|
|
186
|
+
transformOf2
|
|
187
|
+
} from "./index-xegv6a1p.js";
|
|
200
188
|
export {
|
|
201
|
-
|
|
202
|
-
AbstractEntity2 as AbstractEntity,
|
|
203
|
-
AbstractProperty2 as AbstractProperty,
|
|
204
|
-
AbstractRecord2 as AbstractRecord,
|
|
205
|
-
AbstractRepository2 as AbstractRepository,
|
|
206
|
-
AbstractUseCase2 as AbstractUseCase,
|
|
189
|
+
Access2 as Access,
|
|
207
190
|
ApplicationAlreadyStarted2 as ApplicationAlreadyStarted,
|
|
208
191
|
ApplicationConflict2 as ApplicationConflict,
|
|
209
192
|
ApplicationNotStarted2 as ApplicationNotStarted,
|
|
@@ -216,14 +199,16 @@ export {
|
|
|
216
199
|
DateTime2 as DateTime,
|
|
217
200
|
DeletedAt2 as DeletedAt,
|
|
218
201
|
DeletedEntity2 as DeletedEntity,
|
|
219
|
-
Demo2 as Demo,
|
|
220
202
|
DuplicateApplicationDeclaration2 as DuplicateApplicationDeclaration,
|
|
221
203
|
DuplicateOperation2 as DuplicateOperation,
|
|
222
|
-
ENTITY_IDENTITY_KEYS2 as ENTITY_IDENTITY_KEYS,
|
|
223
204
|
Email2 as Email,
|
|
205
|
+
EntitySettings2 as EntitySettings,
|
|
224
206
|
EntityUniqueKeys2 as EntityUniqueKeys,
|
|
207
|
+
EntityVersion2 as EntityVersion,
|
|
225
208
|
Exception2 as Exception,
|
|
226
209
|
ExceptionLayers2 as ExceptionLayers,
|
|
210
|
+
ExpiresAt2 as ExpiresAt,
|
|
211
|
+
Forbidden2 as Forbidden,
|
|
227
212
|
Id2 as Id,
|
|
228
213
|
ImmutableEntityKey2 as ImmutableEntityKey,
|
|
229
214
|
IncompatibleRecordPlugin2 as IncompatibleRecordPlugin,
|
|
@@ -231,10 +216,16 @@ export {
|
|
|
231
216
|
Integer2 as Integer,
|
|
232
217
|
InvalidApplicationDeclaration2 as InvalidApplicationDeclaration,
|
|
233
218
|
InvalidApplicationEnvironment2 as InvalidApplicationEnvironment,
|
|
219
|
+
InvalidBlueprintVariant2 as InvalidBlueprintVariant,
|
|
234
220
|
InvalidCommandContext2 as InvalidCommandContext,
|
|
235
221
|
InvalidCommandDeclaration2 as InvalidCommandDeclaration,
|
|
236
222
|
InvalidCommandEnvironment2 as InvalidCommandEnvironment,
|
|
223
|
+
InvalidEntityExpiry2 as InvalidEntityExpiry,
|
|
224
|
+
InvalidEntitySchemaVersion2 as InvalidEntitySchemaVersion,
|
|
237
225
|
InvalidEnvironment2 as InvalidEnvironment,
|
|
226
|
+
InvalidEventPolicy2 as InvalidEventPolicy,
|
|
227
|
+
InvalidJsonData2 as InvalidJsonData,
|
|
228
|
+
InvalidJsonSchema2 as InvalidJsonSchema,
|
|
238
229
|
InvalidLogDeclaration2 as InvalidLogDeclaration,
|
|
239
230
|
InvalidOpenAPIModel2 as InvalidOpenAPIModel,
|
|
240
231
|
InvalidOutputStage2 as InvalidOutputStage,
|
|
@@ -246,45 +237,47 @@ export {
|
|
|
246
237
|
InvalidRepositoryData2 as InvalidRepositoryData,
|
|
247
238
|
InvalidRepositoryDeclaration2 as InvalidRepositoryDeclaration,
|
|
248
239
|
InvalidRepositoryEntity2 as InvalidRepositoryEntity,
|
|
240
|
+
InvalidRepositoryIncrement2 as InvalidRepositoryIncrement,
|
|
249
241
|
InvalidRepositoryQuery2 as InvalidRepositoryQuery,
|
|
242
|
+
InvalidSchemaMigration2 as InvalidSchemaMigration,
|
|
243
|
+
InvalidStoredSchemaVersion2 as InvalidStoredSchemaVersion,
|
|
250
244
|
InvalidUseCaseDeclaration2 as InvalidUseCaseDeclaration,
|
|
251
245
|
InvalidUseCaseDependencies2 as InvalidUseCaseDependencies,
|
|
252
246
|
InvalidUseCasePlugin2 as InvalidUseCasePlugin,
|
|
253
247
|
InvalidUseCaseStep2 as InvalidUseCaseStep,
|
|
254
248
|
Ip2 as Ip,
|
|
255
|
-
|
|
249
|
+
JsonProperty2 as JsonProperty,
|
|
256
250
|
LogLevels2 as LogLevels,
|
|
257
251
|
Logger2 as Logger,
|
|
258
252
|
MASK2 as MASK,
|
|
259
253
|
Meta2 as Meta,
|
|
260
254
|
NumberProperty2 as NumberProperty,
|
|
261
255
|
Ownable2 as Ownable,
|
|
262
|
-
PASSWORD_MAX_LENGTH2 as PASSWORD_MAX_LENGTH,
|
|
263
|
-
PASSWORD_MIN_LENGTH2 as PASSWORD_MIN_LENGTH,
|
|
264
|
-
PASSWORD_SPECIAL_CHARACTERS2 as PASSWORD_SPECIAL_CHARACTERS,
|
|
265
|
-
PROBLEM_MEDIA_TYPE2 as PROBLEM_MEDIA_TYPE,
|
|
266
256
|
Password2 as Password,
|
|
267
257
|
PasswordHasherRequired2 as PasswordHasherRequired,
|
|
268
258
|
Phone2 as Phone,
|
|
269
259
|
PlainPassword2 as PlainPassword,
|
|
270
260
|
PropertyInput2 as PropertyInput,
|
|
271
261
|
PropertyRequired2 as PropertyRequired,
|
|
272
|
-
PropertyStates2 as PropertyStates,
|
|
273
262
|
ProviderNotBound2 as ProviderNotBound,
|
|
274
263
|
Publishable2 as Publishable,
|
|
275
|
-
|
|
276
|
-
RESERVED_RECORD_KEYS2 as RESERVED_RECORD_KEYS,
|
|
264
|
+
PublisherNotBound2 as PublisherNotBound,
|
|
277
265
|
RecordPluginConflict2 as RecordPluginConflict,
|
|
266
|
+
RepositoryConcurrencyConflict2 as RepositoryConcurrencyConflict,
|
|
278
267
|
RepositoryEntityNotFound2 as RepositoryEntityNotFound,
|
|
279
268
|
RepositoryOf2 as RepositoryOf,
|
|
280
269
|
RepositoryUniqueViolation2 as RepositoryUniqueViolation,
|
|
270
|
+
RepositoryUsedOutsideApplication2 as RepositoryUsedOutsideApplication,
|
|
281
271
|
ReservedBlueprintKey2 as ReservedBlueprintKey,
|
|
282
272
|
ReservedEntityKey2 as ReservedEntityKey,
|
|
283
273
|
ReservedRecordKey2 as ReservedRecordKey,
|
|
274
|
+
Route2 as Route,
|
|
275
|
+
SchemaLockMismatch2 as SchemaLockMismatch,
|
|
284
276
|
SchemaProperty2 as SchemaProperty,
|
|
285
277
|
Slug2 as Slug,
|
|
286
278
|
State2 as State,
|
|
287
279
|
Std2 as Std,
|
|
280
|
+
StdEventPolicies2 as StdEventPolicies,
|
|
288
281
|
StdRecordPlugins2 as StdRecordPlugins,
|
|
289
282
|
StdStages2 as StdStages,
|
|
290
283
|
StdUseCases2 as StdUseCases,
|
|
@@ -292,7 +285,7 @@ export {
|
|
|
292
285
|
SyncVerifyUnsupported2 as SyncVerifyUnsupported,
|
|
293
286
|
Taggable2 as Taggable,
|
|
294
287
|
Text2 as Text,
|
|
295
|
-
|
|
288
|
+
Unauthenticated2 as Unauthenticated,
|
|
296
289
|
UndeclaredBlueprintProperty2 as UndeclaredBlueprintProperty,
|
|
297
290
|
UndeclaredRecordProperty2 as UndeclaredRecordProperty,
|
|
298
291
|
UnknownCommandOperation2 as UnknownCommandOperation,
|
|
@@ -312,6 +305,7 @@ export {
|
|
|
312
305
|
blueprintBuilderOf2 as blueprintBuilderOf,
|
|
313
306
|
blueprintOf2 as blueprintOf,
|
|
314
307
|
blueprintPluginOf2 as blueprintPluginOf,
|
|
308
|
+
checkJsonSchema2 as checkJsonSchema,
|
|
315
309
|
commandBuilderOf2 as commandBuilderOf,
|
|
316
310
|
commandOf2 as commandOf,
|
|
317
311
|
configure2 as configure,
|
|
@@ -321,55 +315,39 @@ export {
|
|
|
321
315
|
enumOf2 as enumOf,
|
|
322
316
|
environmentOf2 as environmentOf,
|
|
323
317
|
eventOf2 as eventOf,
|
|
318
|
+
eventPolicyOf2 as eventPolicyOf,
|
|
324
319
|
exceptionOf2 as exceptionOf,
|
|
325
320
|
guard2 as guard,
|
|
326
321
|
hasPlugin2 as hasPlugin,
|
|
327
322
|
inMemoryProvider2 as inMemoryProvider,
|
|
328
|
-
isApplication2 as isApplication,
|
|
329
|
-
isBlueprint2 as isBlueprint,
|
|
330
|
-
isBlueprintList2 as isBlueprintList,
|
|
331
323
|
isCommand2 as isCommand,
|
|
332
324
|
isEntity2 as isEntity,
|
|
333
325
|
isEntityClass2 as isEntityClass,
|
|
334
|
-
isEnvironment2 as isEnvironment,
|
|
335
|
-
isLogFactory2 as isLogFactory,
|
|
336
|
-
isOptionalRecord2 as isOptionalRecord,
|
|
337
326
|
isOutput2 as isOutput,
|
|
338
|
-
isPasswordHash2 as isPasswordHash,
|
|
339
|
-
isProperty2 as isProperty,
|
|
340
327
|
isProviderFactory2 as isProviderFactory,
|
|
341
|
-
isProviderSlot2 as isProviderSlot,
|
|
342
|
-
isProviderStorage2 as isProviderStorage,
|
|
343
|
-
isRecordClass2 as isRecordClass,
|
|
344
|
-
isRecordPlugin2 as isRecordPlugin,
|
|
345
|
-
isRepository2 as isRepository,
|
|
346
328
|
isUseCase2 as isUseCase,
|
|
347
329
|
isUseCaseCatalog2 as isUseCaseCatalog,
|
|
348
330
|
isUseCaseClass2 as isUseCaseClass,
|
|
349
331
|
isUseCasePlugin2 as isUseCasePlugin,
|
|
350
332
|
jsonLogProvider2 as jsonLogProvider,
|
|
333
|
+
jsonOf2 as jsonOf,
|
|
334
|
+
jsonSchemaIssues2 as jsonSchemaIssues,
|
|
351
335
|
listOf2 as listOf,
|
|
352
336
|
logFrom2 as logFrom,
|
|
353
337
|
logProviderOf2 as logProviderOf,
|
|
354
338
|
memoryLogProvider2 as memoryLogProvider,
|
|
355
339
|
openapi2 as openapi,
|
|
356
340
|
operationOf2 as operationOf,
|
|
357
|
-
operationRoutes2 as operationRoutes,
|
|
358
341
|
optionalOf2 as optionalOf,
|
|
359
342
|
outputOf2 as outputOf,
|
|
360
|
-
outputValueOf2 as outputValueOf,
|
|
361
|
-
passwordIssues2 as passwordIssues,
|
|
362
343
|
pluginsOf2 as pluginsOf,
|
|
363
|
-
problemOf2 as problemOf,
|
|
364
344
|
propertyInputOf2 as propertyInputOf,
|
|
365
|
-
propertyLineageOf2 as propertyLineageOf,
|
|
366
345
|
propertyOf2 as propertyOf,
|
|
367
|
-
providerDescriptionOf2 as providerDescriptionOf,
|
|
368
346
|
providerFrom2 as providerFrom,
|
|
369
347
|
providerOf2 as providerOf,
|
|
370
348
|
providersOf2 as providersOf,
|
|
349
|
+
publishEvents2 as publishEvents,
|
|
371
350
|
recordBuilderOf2 as recordBuilderOf,
|
|
372
|
-
recordFieldOf2 as recordFieldOf,
|
|
373
351
|
recordNameOf2 as recordNameOf,
|
|
374
352
|
recordOf2 as recordOf,
|
|
375
353
|
recordPluginCatalogOf2 as recordPluginCatalogOf,
|
|
@@ -377,20 +355,14 @@ export {
|
|
|
377
355
|
repositoryOf2 as repositoryOf,
|
|
378
356
|
resetApplication2 as resetApplication,
|
|
379
357
|
resetRuntime2 as resetRuntime,
|
|
380
|
-
|
|
381
|
-
schemaOf2 as schemaOf,
|
|
358
|
+
resourceOf2 as resourceOf,
|
|
382
359
|
select2 as select,
|
|
383
|
-
|
|
384
|
-
stageCatalogOf2 as stageCatalogOf,
|
|
385
|
-
stageDescriptionOf2 as stageDescriptionOf,
|
|
386
|
-
stageKindOf2 as stageKindOf,
|
|
387
|
-
statusOf2 as statusOf,
|
|
360
|
+
stripUndeclared2 as stripUndeclared,
|
|
388
361
|
toOpenAPI2 as toOpenAPI,
|
|
389
362
|
transformOf2 as transformOf,
|
|
390
363
|
useApplication2 as useApplication,
|
|
391
364
|
useCaseCatalogOf2 as useCaseCatalogOf,
|
|
392
365
|
useCaseOf2 as useCaseOf,
|
|
393
|
-
useCaseOriginOf2 as useCaseOriginOf,
|
|
394
366
|
useCasePluginOf2 as useCasePluginOf,
|
|
395
|
-
|
|
367
|
+
variantOf2 as variantOf
|
|
396
368
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { enumOf } from "./properties/enum.js";
|
|
2
2
|
import { SchemaProperty } from "./properties/headless.js";
|
|
3
3
|
import { Id, Slug } from "./properties/identity.js";
|
|
4
|
+
import { jsonOf } from "./properties/json.js";
|
|
4
5
|
import { Password } from "./properties/password.js";
|
|
5
6
|
import { CreatedAt, DateTime, DeletedAt, UpdatedAt } from "./properties/time.js";
|
|
6
7
|
/**
|
|
7
|
-
* The standard properties, for blueprints to pick from, and
|
|
8
|
-
* `ctx.enumOf(["draft", "published"])`.
|
|
8
|
+
* The standard properties, for blueprints to pick from, and the factories
|
|
9
|
+
* `enumOf` and `jsonOf`, as `ctx.enumOf(["draft", "published"])`.
|
|
9
10
|
*/
|
|
10
11
|
export declare const Std: import("../index.js").IBlueprintPlugin<{
|
|
11
12
|
id: typeof Id;
|
|
@@ -26,10 +27,13 @@ export declare const Std: import("../index.js").IBlueprintPlugin<{
|
|
|
26
27
|
updatedAt: typeof UpdatedAt;
|
|
27
28
|
deletedAt: typeof DeletedAt;
|
|
28
29
|
schema: typeof SchemaProperty;
|
|
30
|
+
json: import("../index.js").PropertyClass<import("typebox").TUnsafe<import("../index.js").JsonValue>, import("../index.js").JsonValue>;
|
|
29
31
|
}, {
|
|
30
32
|
enumOf: typeof enumOf;
|
|
33
|
+
jsonOf: typeof jsonOf;
|
|
31
34
|
}> & {
|
|
32
35
|
readonly factories: {
|
|
33
36
|
enumOf: typeof enumOf;
|
|
37
|
+
jsonOf: typeof jsonOf;
|
|
34
38
|
};
|
|
35
39
|
};
|
package/dist/std/blueprint.d.ts
CHANGED
|
@@ -22,10 +22,13 @@ export declare const blueprintOf: import("../index.js").BlueprintBuilder<readonl
|
|
|
22
22
|
updatedAt: typeof import("../index.js").UpdatedAt;
|
|
23
23
|
deletedAt: typeof import("../index.js").DeletedAt;
|
|
24
24
|
schema: typeof import("../index.js").SchemaProperty;
|
|
25
|
+
json: import("../index.js").PropertyClass<import("typebox").TUnsafe<import("../index.js").JsonValue>, import("../index.js").JsonValue>;
|
|
25
26
|
}, {
|
|
26
27
|
enumOf: typeof import("../index.js").enumOf;
|
|
28
|
+
jsonOf: typeof import("../index.js").jsonOf;
|
|
27
29
|
}> & {
|
|
28
30
|
readonly factories: {
|
|
29
31
|
enumOf: typeof import("../index.js").enumOf;
|
|
32
|
+
jsonOf: typeof import("../index.js").jsonOf;
|
|
30
33
|
};
|
|
31
34
|
}]>;
|
package/dist/std/entity.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { CreatedAt, DeletedAt, UpdatedAt } from "./properties/time.js";
|
|
|
4
4
|
* An entity of `blueprint`: a record with an `id` (a UUID v7, in
|
|
5
5
|
* `options.unique`) and a `createdAt`, both made when missing from its value,
|
|
6
6
|
* an `updatedAt` set by each change, and a `deletedAt` set by `destroy`, after
|
|
7
|
-
* which it no longer changes
|
|
7
|
+
* which it no longer changes; with `expires: { after }`, an `expiresAt` too.
|
|
8
|
+
* E.g.
|
|
8
9
|
* `class User extends entityOf(blueprintOf((ctx) => ({ name: ctx.string }))) {}`.
|
|
9
10
|
* As a record, the class can be a field of another blueprint, e.g.
|
|
10
11
|
* `{ author: User }`, with `optionalOf` and `listOf`. `options.plugins` picks
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Issue } from "../../core/parse/types/parse.interface.js";
|
|
2
|
+
/**
|
|
3
|
+
* JSON data that its JSON Schema rejects, or that is not JSON at all, as
|
|
4
|
+
* `checkJsonSchema` finds it; `details.issues` says where and why (so
|
|
5
|
+
* `statusOf` gives 400).
|
|
6
|
+
*/
|
|
7
|
+
export declare const InvalidJsonData: import("../../index.js").DeclaredExceptionClass<{
|
|
8
|
+
readonly issues: readonly Issue[];
|
|
9
|
+
}>;
|
|
10
|
+
/** A schema given to `jsonOf` or `checkJsonSchema` that is not a JSON Schema (draft 2020-12). */
|
|
11
|
+
export declare const InvalidJsonSchema: import("../../index.js").DeclaredExceptionClass<undefined>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type Static, type TOptional, type TSchema, Type } from "typebox";
|
|
2
|
+
import type { Issue } from "../../core/parse/types/parse.interface.js";
|
|
3
|
+
import { type PropertyClass } from "../../core/property/property.js";
|
|
4
|
+
/** A value JSON can hold, as `JSON.parse` gives it. */
|
|
5
|
+
export type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
|
|
6
|
+
readonly [key: string]: JsonValue;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Every issue that keeps `value` from being JSON valid for `schema` (a JSON
|
|
10
|
+
* Schema, draft 2020-12, or a TypeBox type), as afora issues: empty when
|
|
11
|
+
* there is none. For schemas known at runtime only, e.g. loaded from a
|
|
12
|
+
* database: TypeBox checks the value by walking the schema, compiling
|
|
13
|
+
* nothing. Throws `InvalidJsonSchema` when `schema` is not a JSON Schema.
|
|
14
|
+
*/
|
|
15
|
+
export declare function jsonSchemaIssues(schema: unknown, value: unknown, { source }?: {
|
|
16
|
+
readonly source?: string;
|
|
17
|
+
}): readonly Issue[];
|
|
18
|
+
/**
|
|
19
|
+
* `value`, when it is JSON valid for `schema`; else throws `InvalidJsonData`
|
|
20
|
+
* with every issue in `details.issues` (a 400 for `statusOf`). `source` names
|
|
21
|
+
* what is checked in the issues and the exception, e.g. the content type.
|
|
22
|
+
* The value is typed by a schema whose type is known (`Static`), else as
|
|
23
|
+
* `JsonValue`, as for a schema loaded at runtime. See `jsonSchemaIssues`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function checkJsonSchema<const Schema extends TSchema>(schema: Schema, value: unknown, options?: {
|
|
26
|
+
readonly source?: string;
|
|
27
|
+
}): Static<Schema>;
|
|
28
|
+
export declare function checkJsonSchema(schema: unknown, value: unknown, options?: {
|
|
29
|
+
readonly source?: string;
|
|
30
|
+
}): JsonValue;
|
|
31
|
+
/**
|
|
32
|
+
* Any JSON value: `null`, a boolean, a finite number, a string, or a list or
|
|
33
|
+
* plain object of them, at any depth. Rejects `undefined` (in a list or an
|
|
34
|
+
* object too), functions, `NaN`, class instances such as `Date`, and cycles.
|
|
35
|
+
* For JSON of a known shape, `jsonOf({ schema })`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const JsonProperty: PropertyClass<Type.TUnsafe<JsonValue>, JsonValue>;
|
|
38
|
+
/** A class declared with `jsonOf`. */
|
|
39
|
+
export type JsonClass<Schema extends TSchema, Optional extends boolean = false> = PropertyClass<Optional extends true ? TOptional<Schema> : Schema, Static<Schema>>;
|
|
40
|
+
/**
|
|
41
|
+
* JSON checked by a JSON Schema (draft 2020-12) known when the property is
|
|
42
|
+
* declared, written as JSON (`{ type: "object", properties: {...} }`, typed
|
|
43
|
+
* as `Static` gives it) or with TypeBox (`Type.Object({...})`). Its issues
|
|
44
|
+
* are at the path of the data that breaks the schema. Throws
|
|
45
|
+
* `InvalidJsonSchema` for a schema that is not a JSON Schema. For a schema
|
|
46
|
+
* known only at runtime, `checkJsonSchema`.
|
|
47
|
+
*/
|
|
48
|
+
export declare function jsonOf<const Schema extends TSchema, Optional extends boolean = false>({ schema, name, optional, default: _default, }: {
|
|
49
|
+
readonly schema: Schema;
|
|
50
|
+
readonly name?: string;
|
|
51
|
+
readonly optional?: Optional;
|
|
52
|
+
/** The demo value; one TypeBox makes from the schema, when it can, by default. */
|
|
53
|
+
readonly default?: Static<Schema>;
|
|
54
|
+
}): JsonClass<Schema, Optional>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
import { type IPropertyInput, PropertyInput } from "../../core/property/input.js";
|
|
3
|
-
export declare const PASSWORD_MIN_LENGTH = 7;
|
|
4
3
|
export declare const PASSWORD_MAX_LENGTH = 128;
|
|
5
|
-
export declare const PASSWORD_SPECIAL_CHARACTERS = "!@#$%^&*()-_=+[]{}|\\;:'\",.<>/?`~";
|
|
6
4
|
export declare function isPasswordHash(value: string): boolean;
|
|
7
5
|
/** The rules a plain password breaks; empty when it is strong enough. */
|
|
8
6
|
export declare function passwordIssues(value: string): string[];
|
|
@@ -23,4 +23,8 @@ declare const DeletedAt_base: DateTimeClass<true>;
|
|
|
23
23
|
/** When a record was soft-deleted; absent while it is not. */
|
|
24
24
|
export declare class DeletedAt extends DeletedAt_base {
|
|
25
25
|
}
|
|
26
|
+
declare const ExpiresAt_base: DateTimeClass<false>;
|
|
27
|
+
/** When a record expires, for entities declared with `expires: { after }`. */
|
|
28
|
+
export declare class ExpiresAt extends ExpiresAt_base {
|
|
29
|
+
}
|
|
26
30
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Password } from "./properties/password.js";
|
|
2
2
|
declare const PublishableRecord_base: import("../index.js").RecordConstructor<import("../core/property/types/property-options.interface.js").StoredFields<{
|
|
3
3
|
publishedAt: import("../index.js").CallableProperty<Omit<typeof import("../index.js").DateTime, "prototype" | "safeParse" | "type" | "~standard" | typeof import("../core/property/types/property-options.interface.js").Callable> & {
|
|
4
|
-
new (value: string | undefined): import("../
|
|
4
|
+
new (value: string | undefined): import("../core/property/abstract-property.js").AbstractProperty<import("typebox").TOptional<import("typebox").TString>, string> & Omit<import("../index.js").DateTime, keyof import("../core/property/abstract-property.js").AbstractProperty<import("typebox").TSchema, unknown>>;
|
|
5
5
|
readonly type: import("../index.js").IPropertyType<import("typebox").TOptional<import("typebox").TString>, string>;
|
|
6
6
|
safeParse(value: unknown): import("../index.js").ParseResult<string | undefined>;
|
|
7
7
|
readonly "~standard": import("../index.js").StandardSchemaV1.Props<string | undefined, string | undefined>;
|
|
@@ -25,7 +25,7 @@ export declare class PublishableRecord extends PublishableRecord_base {
|
|
|
25
25
|
export declare const Publishable: import("../index.js").IRecordPlugin<typeof PublishableRecord, "publishable">;
|
|
26
26
|
declare const ArchivableRecord_base: import("../index.js").RecordConstructor<import("../core/property/types/property-options.interface.js").StoredFields<{
|
|
27
27
|
archivedAt: import("../index.js").CallableProperty<Omit<typeof import("../index.js").DateTime, "prototype" | "safeParse" | "type" | "~standard" | typeof import("../core/property/types/property-options.interface.js").Callable> & {
|
|
28
|
-
new (value: string | undefined): import("../
|
|
28
|
+
new (value: string | undefined): import("../core/property/abstract-property.js").AbstractProperty<import("typebox").TOptional<import("typebox").TString>, string> & Omit<import("../index.js").DateTime, keyof import("../core/property/abstract-property.js").AbstractProperty<import("typebox").TSchema, unknown>>;
|
|
29
29
|
readonly type: import("../index.js").IPropertyType<import("typebox").TOptional<import("typebox").TString>, string>;
|
|
30
30
|
safeParse(value: unknown): import("../index.js").ParseResult<string | undefined>;
|
|
31
31
|
readonly "~standard": import("../index.js").StandardSchemaV1.Props<string | undefined, string | undefined>;
|