@platforma-sdk/model 1.81.1 → 1.83.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/dist/bconfig/index.d.ts +2 -2
- package/dist/bconfig/lambdas.d.ts +2 -12
- package/dist/bconfig/lambdas.d.ts.map +1 -1
- package/dist/bconfig/v3.d.ts +1 -1
- package/dist/block_migrations.cjs +92 -8
- package/dist/block_migrations.cjs.map +1 -1
- package/dist/block_migrations.d.ts +121 -32
- package/dist/block_migrations.d.ts.map +1 -1
- package/dist/block_migrations.js +92 -8
- package/dist/block_migrations.js.map +1 -1
- package/dist/block_model.cjs +71 -17
- package/dist/block_model.cjs.map +1 -1
- package/dist/block_model.d.ts +58 -22
- package/dist/block_model.d.ts.map +1 -1
- package/dist/block_model.js +72 -18
- package/dist/block_model.js.map +1 -1
- package/dist/block_storage_callbacks.cjs +194 -13
- package/dist/block_storage_callbacks.cjs.map +1 -1
- package/dist/block_storage_callbacks.js +192 -15
- package/dist/block_storage_callbacks.js.map +1 -1
- package/dist/block_storage_facade.cjs +4 -1
- package/dist/block_storage_facade.cjs.map +1 -1
- package/dist/block_storage_facade.d.ts +102 -0
- package/dist/block_storage_facade.d.ts.map +1 -1
- package/dist/block_storage_facade.js +4 -1
- package/dist/block_storage_facade.js.map +1 -1
- package/dist/config/index.d.ts +2 -6
- package/dist/config/type_engine.d.ts +7 -28
- package/dist/config/type_engine.d.ts.map +1 -1
- package/dist/index.cjs +20 -60
- package/dist/index.d.ts +5 -11
- package/dist/index.js +4 -8
- package/dist/package.cjs +1 -1
- package/dist/package.js +1 -1
- package/dist/render/api.cjs +0 -22
- package/dist/render/api.cjs.map +1 -1
- package/dist/render/api.d.ts +1 -9
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/api.js +1 -22
- package/dist/render/api.js.map +1 -1
- package/dist/render/index.cjs +0 -1
- package/dist/render/index.d.ts +2 -2
- package/dist/render/index.js +2 -2
- package/package.json +10 -9
- package/src/bconfig/lambdas.ts +1 -25
- package/src/block_migrations.ts +205 -55
- package/src/block_model.ts +190 -59
- package/src/block_storage_callbacks.ts +294 -15
- package/src/block_storage_facade.ts +95 -0
- package/src/config/index.ts +0 -4
- package/src/config/type_engine.ts +6 -49
- package/src/index.ts +0 -2
- package/src/kind_reference.test.ts +134 -0
- package/src/render/api.ts +0 -32
- package/src/template_init.test.ts +413 -0
- package/src/template_params.test.ts +135 -0
- package/src/typing.test.ts +4 -143
- package/dist/block_model_legacy.cjs +0 -240
- package/dist/block_model_legacy.cjs.map +0 -1
- package/dist/block_model_legacy.d.ts +0 -115
- package/dist/block_model_legacy.d.ts.map +0 -1
- package/dist/block_model_legacy.js +0 -240
- package/dist/block_model_legacy.js.map +0 -1
- package/dist/config/actions.cjs +0 -232
- package/dist/config/actions.cjs.map +0 -1
- package/dist/config/actions.d.ts +0 -48
- package/dist/config/actions.d.ts.map +0 -1
- package/dist/config/actions.js +0 -201
- package/dist/config/actions.js.map +0 -1
- package/dist/config/actions_kinds.d.ts +0 -116
- package/dist/config/actions_kinds.d.ts.map +0 -1
- package/dist/config/index.cjs +0 -33
- package/dist/config/index.js +0 -2
- package/dist/config/model_meta.d.ts +0 -9
- package/dist/config/model_meta.d.ts.map +0 -1
- package/dist/config/type_util.d.ts +0 -14
- package/dist/config/type_util.d.ts.map +0 -1
- package/dist/ref_util.cjs +0 -21
- package/dist/ref_util.cjs.map +0 -1
- package/dist/ref_util.d.ts +0 -19
- package/dist/ref_util.d.ts.map +0 -1
- package/dist/ref_util.js +0 -20
- package/dist/ref_util.js.map +0 -1
- package/src/block_model_legacy.ts +0 -465
- package/src/config/actions.ts +0 -468
- package/src/config/actions_kinds.ts +0 -264
- package/src/config/model_meta.ts +0 -5
- package/src/config/type_util.ts +0 -25
- package/src/ref_util.ts +0 -17
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import type { ConfAction, ActionResult, InferVarTypeSafe, PlResourceEntry } from "./type_engine";
|
|
2
|
-
import type { And, IsA, SyncConfAction } from "./type_util";
|
|
3
|
-
import type {
|
|
4
|
-
LocalBlobHandleAndSize,
|
|
5
|
-
RemoteBlobHandleAndSize,
|
|
6
|
-
ImportProgress,
|
|
7
|
-
FolderURL,
|
|
8
|
-
} from "@milaboratories/pl-model-common";
|
|
9
|
-
import type { AnyLogHandle } from "@milaboratories/pl-model-common";
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
// Context
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
export interface ActGetFromCtx<V extends string> extends ConfAction {
|
|
16
|
-
new: (x: this["ctx"]) => InferVarTypeSafe<typeof x, V>;
|
|
17
|
-
isSync: true;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//
|
|
21
|
-
// Isolate
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
export interface ActIsolate<Nested extends ConfAction> extends ConfAction {
|
|
25
|
-
new: (x: this["ctx"]) => ActionResult<Nested, typeof x>;
|
|
26
|
-
isSync: false;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
//
|
|
30
|
-
// Json Constructors
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
export interface ActGetImmediate<T> extends ConfAction {
|
|
34
|
-
new: () => T;
|
|
35
|
-
isSync: true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface ActMakeObject<T extends Record<string, ConfAction>> extends ConfAction {
|
|
39
|
-
new: (x: this["ctx"]) => {
|
|
40
|
-
[Key in keyof T]: ActionResult<T[Key], typeof x>;
|
|
41
|
-
};
|
|
42
|
-
isSync: IsA<T, Record<string, SyncConfAction>>;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface ActMakeArray<T extends ConfAction[]> extends ConfAction {
|
|
46
|
-
new: (x: this["ctx"]) => {
|
|
47
|
-
[Key in keyof T]: ActionResult<T[Key], typeof x>;
|
|
48
|
-
};
|
|
49
|
-
isSync: IsA<T, SyncConfAction[]>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
// Json Transformers
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
export interface ActGetField<
|
|
57
|
-
Source extends ConfAction,
|
|
58
|
-
Field extends ConfAction,
|
|
59
|
-
> extends ConfAction {
|
|
60
|
-
new: (
|
|
61
|
-
x: this["ctx"],
|
|
62
|
-
) => InferVarTypeSafe<ActionResult<Source, typeof x>, ActionResult<Field, typeof x>>;
|
|
63
|
-
isSync: true;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface ActMapRecordValues<
|
|
67
|
-
Source extends ConfAction,
|
|
68
|
-
Mapping extends ConfAction,
|
|
69
|
-
ItVar extends string,
|
|
70
|
-
> extends ConfAction {
|
|
71
|
-
new: (
|
|
72
|
-
x: this["ctx"],
|
|
73
|
-
) => ActionResult<Source, typeof x> extends Record<string, infer V>
|
|
74
|
-
? Record<string, ActionResult<Mapping, typeof x & { [K in ItVar]: V }>>
|
|
75
|
-
: unknown;
|
|
76
|
-
isSync: And<IsA<Source, SyncConfAction>, IsA<Mapping, SyncConfAction>>;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface ActMapArrayValues<
|
|
80
|
-
Source extends ConfAction,
|
|
81
|
-
Mapping extends ConfAction,
|
|
82
|
-
ItVar extends string,
|
|
83
|
-
> extends ConfAction {
|
|
84
|
-
new: (
|
|
85
|
-
x: this["ctx"],
|
|
86
|
-
) => ActionResult<Source, typeof x> extends (infer V)[]
|
|
87
|
-
? ActionResult<Mapping, typeof x & { [K in ItVar]: V }>[]
|
|
88
|
-
: unknown;
|
|
89
|
-
isSync: And<IsA<Source, SyncConfAction>, IsA<Mapping, SyncConfAction>>;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface ActFlatten<Sources extends ConfAction> extends ConfAction {
|
|
93
|
-
new: (x: this["ctx"]) => ActionResult<Sources, typeof x> extends (infer V)[][] ? V[] : unknown;
|
|
94
|
-
isSync: IsA<Sources, SyncConfAction[]>;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
//
|
|
98
|
-
// Boolean
|
|
99
|
-
//
|
|
100
|
-
|
|
101
|
-
export interface ActIsEmpty<Source extends ConfAction> extends ConfAction {
|
|
102
|
-
new: (
|
|
103
|
-
x: this["ctx"],
|
|
104
|
-
) => ActionResult<Source, typeof x> extends unknown[] | string | undefined ? boolean : unknown;
|
|
105
|
-
isSync: IsA<Source, SyncConfAction>;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface ActNot<Source extends ConfAction> extends ConfAction {
|
|
109
|
-
new: (x: this["ctx"]) => ActionResult<Source, typeof x> extends boolean ? boolean : unknown;
|
|
110
|
-
isSync: IsA<Source, SyncConfAction>;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export interface ActAnd<Source1 extends ConfAction, Source2 extends ConfAction> extends ConfAction {
|
|
114
|
-
new: (
|
|
115
|
-
x: this["ctx"],
|
|
116
|
-
) => ActionResult<Source1, typeof x> extends boolean
|
|
117
|
-
? ActionResult<Source2, typeof x> extends boolean
|
|
118
|
-
? boolean
|
|
119
|
-
: unknown
|
|
120
|
-
: unknown;
|
|
121
|
-
isSync: IsA<Source1, SyncConfAction> & IsA<Source2, SyncConfAction>;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export interface ActOr<Source1 extends ConfAction, Source2 extends ConfAction> extends ConfAction {
|
|
125
|
-
new: (
|
|
126
|
-
x: this["ctx"],
|
|
127
|
-
) => ActionResult<Source1, typeof x> extends boolean
|
|
128
|
-
? ActionResult<Source2, typeof x> extends boolean
|
|
129
|
-
? boolean
|
|
130
|
-
: unknown
|
|
131
|
-
: unknown;
|
|
132
|
-
isSync: IsA<Source1, SyncConfAction> & IsA<Source2, SyncConfAction>;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
//
|
|
136
|
-
// Resource
|
|
137
|
-
//
|
|
138
|
-
|
|
139
|
-
export interface ActGetResourceField<
|
|
140
|
-
Source extends ConfAction,
|
|
141
|
-
Field extends ConfAction,
|
|
142
|
-
> extends ConfAction {
|
|
143
|
-
new: (
|
|
144
|
-
x: this["ctx"],
|
|
145
|
-
) => ActionResult<Source, typeof x> extends PlResourceEntry
|
|
146
|
-
? ActionResult<Field, typeof x> extends string
|
|
147
|
-
? PlResourceEntry
|
|
148
|
-
: unknown
|
|
149
|
-
: unknown;
|
|
150
|
-
isSync: And<IsA<Source, SyncConfAction>, IsA<Field, SyncConfAction>>;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export interface ActMapResourceFields<
|
|
154
|
-
Source extends ConfAction,
|
|
155
|
-
Mapping extends ConfAction,
|
|
156
|
-
ItVar extends string,
|
|
157
|
-
> extends ConfAction {
|
|
158
|
-
new: (
|
|
159
|
-
x: this["ctx"],
|
|
160
|
-
) => ActionResult<Source, typeof x> extends PlResourceEntry
|
|
161
|
-
? Record<string, ActionResult<Mapping, typeof x & { [K in ItVar]: PlResourceEntry }>>
|
|
162
|
-
: unknown;
|
|
163
|
-
isSync: And<IsA<Source, SyncConfAction>, IsA<Mapping, SyncConfAction>>;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
//
|
|
167
|
-
// Resource To Json
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
export interface ActGetResourceValueAsJson<Source extends ConfAction, T> extends ConfAction {
|
|
171
|
-
new: (x: this["ctx"]) => ActionResult<Source, typeof x> extends PlResourceEntry ? T : unknown;
|
|
172
|
-
isSync: IsA<Source, SyncConfAction>;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
//
|
|
176
|
-
// Download Blobs
|
|
177
|
-
//
|
|
178
|
-
|
|
179
|
-
export interface ActGetBlobContent<Source extends ConfAction> extends ConfAction {
|
|
180
|
-
new: (
|
|
181
|
-
x: this["ctx"],
|
|
182
|
-
) => ActionResult<Source, typeof x> extends PlResourceEntry ? Uint8Array : unknown;
|
|
183
|
-
isSync: IsA<Source, SyncConfAction>;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export interface ActGetBlobContentAsString<Source extends ConfAction> extends ConfAction {
|
|
187
|
-
new: (
|
|
188
|
-
x: this["ctx"],
|
|
189
|
-
) => ActionResult<Source, typeof x> extends PlResourceEntry ? string : unknown;
|
|
190
|
-
isSync: IsA<Source, SyncConfAction>;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export interface ActGetBlobContentAsJson<Source extends ConfAction, T> extends ConfAction {
|
|
194
|
-
new: (x: this["ctx"]) => ActionResult<Source, typeof x> extends PlResourceEntry ? T : unknown;
|
|
195
|
-
isSync: IsA<Source, SyncConfAction>;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export interface ActGetDownloadedBlobContent<Source extends ConfAction> extends ConfAction {
|
|
199
|
-
new: (
|
|
200
|
-
x: this["ctx"],
|
|
201
|
-
) => ActionResult<Source, typeof x> extends PlResourceEntry ? LocalBlobHandleAndSize : unknown;
|
|
202
|
-
isSync: IsA<Source, SyncConfAction>;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export interface ActGetOnDemandBlobContent<Source extends ConfAction> extends ConfAction {
|
|
206
|
-
new: (
|
|
207
|
-
x: this["ctx"],
|
|
208
|
-
) => ActionResult<Source, typeof x> extends PlResourceEntry ? RemoteBlobHandleAndSize : unknown;
|
|
209
|
-
isSync: IsA<Source, SyncConfAction>;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
//
|
|
213
|
-
// Download Blobs to URLs
|
|
214
|
-
//
|
|
215
|
-
|
|
216
|
-
export interface ActExtractArchiveAndGetURL<Source extends ConfAction> extends ConfAction {
|
|
217
|
-
new: (
|
|
218
|
-
x: this["ctx"],
|
|
219
|
-
) => ActionResult<Source, typeof x> extends PlResourceEntry ? FolderURL : unknown;
|
|
220
|
-
isSync: IsA<Source, SyncConfAction>;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
//
|
|
224
|
-
// Upload Blobs
|
|
225
|
-
//
|
|
226
|
-
|
|
227
|
-
export interface ActImportProgress<Source extends ConfAction> extends ConfAction {
|
|
228
|
-
new: (
|
|
229
|
-
x: this["ctx"],
|
|
230
|
-
) => ActionResult<Source, typeof x> extends PlResourceEntry ? ImportProgress : unknown;
|
|
231
|
-
isSync: IsA<Source, SyncConfAction>;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
//
|
|
235
|
-
// Logs
|
|
236
|
-
//
|
|
237
|
-
|
|
238
|
-
export interface ActGetLastLogs<Source extends ConfAction> extends ConfAction {
|
|
239
|
-
new: (
|
|
240
|
-
x: this["ctx"],
|
|
241
|
-
) => ActionResult<Source, typeof x> extends PlResourceEntry ? string : unknown;
|
|
242
|
-
isSync: IsA<Source, SyncConfAction>;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
export interface ActGetProgressLog<Source extends ConfAction> extends ConfAction {
|
|
246
|
-
new: (
|
|
247
|
-
x: this["ctx"],
|
|
248
|
-
) => ActionResult<Source, typeof x> extends PlResourceEntry ? string : unknown;
|
|
249
|
-
isSync: IsA<Source, SyncConfAction>;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
export interface ActGetProgressLogWithInfo<Source extends ConfAction> extends ConfAction {
|
|
253
|
-
new: (
|
|
254
|
-
x: this["ctx"],
|
|
255
|
-
) => ActionResult<Source, typeof x> extends PlResourceEntry ? string : unknown;
|
|
256
|
-
isSync: IsA<Source, SyncConfAction>;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
export interface ActGetLogHandle<Source extends ConfAction> extends ConfAction {
|
|
260
|
-
new: (
|
|
261
|
-
x: this["ctx"],
|
|
262
|
-
) => ActionResult<Source, typeof x> extends PlResourceEntry ? AnyLogHandle : unknown;
|
|
263
|
-
isSync: IsA<Source, SyncConfAction>;
|
|
264
|
-
}
|
package/src/config/model_meta.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/** Divides all configurations into two broad classes. Some configs can be
|
|
2
|
-
* executed synchronously, given all their arguments are already rendered.
|
|
3
|
-
* Some require creation of a separate rendering cell, like downloading
|
|
4
|
-
* files. */
|
|
5
|
-
export type CfgRenderingMode = "Sync" | "Async";
|
package/src/config/type_util.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ExtractAction, TypedConfig } from "./type_engine";
|
|
2
|
-
|
|
3
|
-
export type SyncConfAction = { isSync: true };
|
|
4
|
-
|
|
5
|
-
export type IsSyncConf<Cfg extends TypedConfig> =
|
|
6
|
-
ExtractAction<Cfg> extends SyncConfAction ? true : false;
|
|
7
|
-
export type CheckedSyncConf<Cfg extends TypedConfig> = Checked<Cfg, IsSyncConf<Cfg>>;
|
|
8
|
-
|
|
9
|
-
export type Not<T extends boolean> = T extends true ? false : true;
|
|
10
|
-
|
|
11
|
-
export type Or<A extends boolean, B extends boolean> = A extends true
|
|
12
|
-
? true
|
|
13
|
-
: B extends true
|
|
14
|
-
? true
|
|
15
|
-
: false;
|
|
16
|
-
|
|
17
|
-
export type And<A extends boolean, B extends boolean> = A extends true
|
|
18
|
-
? B extends true
|
|
19
|
-
? true
|
|
20
|
-
: false
|
|
21
|
-
: false;
|
|
22
|
-
|
|
23
|
-
export type IsA<T, E> = T extends E ? true : false;
|
|
24
|
-
|
|
25
|
-
export type Checked<Type, Condition> = Condition extends true ? Type : "error";
|
package/src/ref_util.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { TypedConfig } from "./config";
|
|
2
|
-
import { getJsonField, makeObject } from "./config";
|
|
3
|
-
|
|
4
|
-
export function fromPlRef<Source extends TypedConfig>(source: Source) {
|
|
5
|
-
return makeObject({
|
|
6
|
-
__isRef: true,
|
|
7
|
-
blockId: getJsonField(source, "blockId"),
|
|
8
|
-
name: getJsonField(source, "name"),
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function fromPlOption<Source extends TypedConfig>(source: Source) {
|
|
13
|
-
return makeObject({
|
|
14
|
-
ref: fromPlRef(getJsonField(source, "ref")),
|
|
15
|
-
label: getJsonField(source, "label"),
|
|
16
|
-
});
|
|
17
|
-
}
|