simetra 0.3.0-next.1 → 0.3.0-next.11
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/compiler/index.d.ts +50 -10
- package/dist/compiler/index.js +2578 -939
- package/dist/data/index.js +521 -162
- package/dist/model/index.d.ts +397 -43
- package/dist/model/index.js +171 -13
- package/dist/schema/index.d.ts +29 -7
- package/dist/schema/index.js +58 -15
- package/dist/server/index.d.ts +71 -26
- package/dist/server/index.js +418 -91
- package/dist/shell/index.d.ts +12 -0
- package/dist/shell/index.js +12 -1
- package/dist/ui/index.js +29 -3
- package/package.json +2 -1
- package/schemas/catalogs.schema.json +3 -26
- package/schemas/documents.schema.json +3 -26
- package/schemas/project.schema.json +195 -0
- package/schemas/rights-sets.schema.json +17 -1
- package/schemas/roles.schema.json +19 -2
package/dist/model/index.js
CHANGED
|
@@ -939,7 +939,8 @@ const STANDARD_ACTIONS = [
|
|
|
939
939
|
"unpost",
|
|
940
940
|
"write",
|
|
941
941
|
"publish",
|
|
942
|
-
"unpublish"
|
|
942
|
+
"unpublish",
|
|
943
|
+
"acceptInvitation"
|
|
943
944
|
];
|
|
944
945
|
const readAction = {
|
|
945
946
|
name: "read",
|
|
@@ -1034,6 +1035,23 @@ const unpublishAction = {
|
|
|
1034
1035
|
to: false
|
|
1035
1036
|
}
|
|
1036
1037
|
};
|
|
1038
|
+
/**
|
|
1039
|
+
* Accepting an invitation (invitations spec §5): the user column of a pending
|
|
1040
|
+
* member row becomes the current user. The compiler adds it to the membership
|
|
1041
|
+
* catalog of a scope kind with invitations.
|
|
1042
|
+
*/
|
|
1043
|
+
const acceptInvitationAction = {
|
|
1044
|
+
name: "acceptInvitation",
|
|
1045
|
+
requires: [],
|
|
1046
|
+
effects: {
|
|
1047
|
+
dml: ["update"],
|
|
1048
|
+
header: [],
|
|
1049
|
+
tabularSections: false
|
|
1050
|
+
},
|
|
1051
|
+
platform: true
|
|
1052
|
+
};
|
|
1053
|
+
/** Words of the platform actions: no grant may name them. */
|
|
1054
|
+
const PLATFORM_ACTIONS = new Set([acceptInvitationAction].map((action) => action.name));
|
|
1037
1055
|
function createAction(tabularSections) {
|
|
1038
1056
|
return {
|
|
1039
1057
|
name: "create",
|
|
@@ -1184,6 +1202,12 @@ const customActionsSchema = z.array(customActionSchema).default([]).meta({ descr
|
|
|
1184
1202
|
* «коментар задачі належить виконавцю задачі».
|
|
1185
1203
|
*/
|
|
1186
1204
|
const rightsCarrierSchema = z.union([elementNameSchema, z.tuple([elementNameSchema, elementNameSchema])]).meta({ description: "An attribute of this object, or a path [attribute, attribute of its target]" });
|
|
1205
|
+
/**
|
|
1206
|
+
* Прив'язка до контейнера прав (Р-К1-6): один реквізит-посилання. Ланцюжок
|
|
1207
|
+
* об'єктів будується прив'язкою кожного проміжного об'єкта, а не шляхом у
|
|
1208
|
+
* одному полі: кожен крок — власний об'єкт зі своїми політиками.
|
|
1209
|
+
*/
|
|
1210
|
+
const containerBindingSchema = elementNameSchema.meta({ description: "Attribute of this object that binds a row to its rights container, or to an object bound to one (a chain of bindings)." });
|
|
1187
1211
|
/** Власники рядка (спека прав §4.2): порожній перелік — це відсутність поля. */
|
|
1188
1212
|
const ownershipSchema = z.array(rightsCarrierSchema).min(1);
|
|
1189
1213
|
/**
|
|
@@ -1297,14 +1321,14 @@ const roleAssignedOnSchema = z.union([assignedOnSchema, z.literal("everyUser").m
|
|
|
1297
1321
|
/**
|
|
1298
1322
|
* Шапка декларацій прав: без PG-схеми, скоупу й фізичного імені — у базі
|
|
1299
1323
|
* набір і роль живуть лише в згенерованій проєкції, а в даних їх називає
|
|
1300
|
-
* UUID. `title
|
|
1301
|
-
*
|
|
1324
|
+
* UUID. `title` — необов'язкова назва для екрана призначення (без
|
|
1325
|
+
* значення за замовчуванням: хеш проєкту без неї не змінюється);
|
|
1326
|
+
* `description` відкладено (спека «Споживач поза монорепо» §5.4).
|
|
1302
1327
|
*/
|
|
1303
1328
|
const rightsDeclarationHeader = z.object(objectHeaderShape).omit({
|
|
1304
1329
|
schema: true,
|
|
1305
1330
|
scope: true,
|
|
1306
1331
|
physicalName: true,
|
|
1307
|
-
title: true,
|
|
1308
1332
|
description: true
|
|
1309
1333
|
}).shape;
|
|
1310
1334
|
const includeSchema$1 = z.array(metadataRefSchema).default([]).meta({ description: "Rights sets whose grants this declaration includes." });
|
|
@@ -1427,7 +1451,7 @@ const catalogSchema = z.strictObject({
|
|
|
1427
1451
|
customActions: customActionsSchema,
|
|
1428
1452
|
access: accessSchema.optional(),
|
|
1429
1453
|
ownership: ownershipSchema.optional().meta({ description: "Owners of a row: users or members the own extent of a grant opens the row to." }),
|
|
1430
|
-
containerBinding:
|
|
1454
|
+
containerBinding: containerBindingSchema.optional().meta({ description: "Attribute that binds a row to its rights container (the catalog flagged rightsContainer) or to an object that is itself bound: a chain of bindings." }),
|
|
1431
1455
|
rightsContainer: z.boolean().optional().meta({ description: "Marks the catalog as a rights container: objects bind to its rows with containerBinding, and a grant on the container covers them." }),
|
|
1432
1456
|
storage: storageSchema.optional(),
|
|
1433
1457
|
standardAttributeOverrides: standardAttributeOverridesSchema,
|
|
@@ -1868,7 +1892,7 @@ const documentSchema = z.strictObject({
|
|
|
1868
1892
|
customActions: customActionsSchema,
|
|
1869
1893
|
access: accessSchema.optional(),
|
|
1870
1894
|
ownership: ownershipSchema.optional().meta({ description: "Owners of a row: users or members the own extent of a grant opens the row to." }),
|
|
1871
|
-
containerBinding:
|
|
1895
|
+
containerBinding: containerBindingSchema.optional().meta({ description: "Attribute that binds a row to its rights container (the catalog flagged rightsContainer) or to an object that is itself bound: a chain of bindings." }),
|
|
1872
1896
|
standardAttributeOverrides: standardAttributeOverridesSchema,
|
|
1873
1897
|
attributes: z.array(attributeSchema).default([]).meta({ description: "Custom attributes of the document." }),
|
|
1874
1898
|
tabularSections: z.array(tabularSectionSchema).default([]).meta({ description: "Tabular sections of the document." }),
|
|
@@ -2833,6 +2857,19 @@ const projectSchema = z.strictObject({
|
|
|
2833
2857
|
*/
|
|
2834
2858
|
timezone: z.string().min(1).default("UTC").meta({ description: "IANA time zone in which the platform determines day, month, quarter and year." }),
|
|
2835
2859
|
selfSignUp: z.boolean().optional().meta({ description: "Whether users may register themselves; enables the self sign-up warning and host start check." }),
|
|
2860
|
+
invitations: z.strictObject({ expiresInHours: z.number().int().min(1).max(8760).meta({ description: "Hours an invitation secret stays valid after it is issued, 1 to 8760." }) }).optional().meta({ description: "Invitations to scope kinds with a membership catalog and system role assignments; absent — no invitations." }),
|
|
2861
|
+
selfSignUpAccepted: z.strictObject({
|
|
2862
|
+
objects: z.array(z.strictObject({
|
|
2863
|
+
object: metadataRefSchema.meta({ description: "Object with publicRead authenticated accepted as open to anyone." }),
|
|
2864
|
+
published: z.literal(true).optional().meta({ description: "Accept only the published rows (the conditional publicRead); without it every row is accepted." })
|
|
2865
|
+
})).default([]).meta({ description: "Objects accepted as open to every signed-in user (publicRead authenticated)." }),
|
|
2866
|
+
grants: z.array(z.strictObject({
|
|
2867
|
+
role: metadataRefSchema.meta({ description: "Role of the everyUser level." }),
|
|
2868
|
+
object: metadataRefSchema.meta({ description: "Object of the grant." }),
|
|
2869
|
+
actions: z.array(elementNameSchema).min(1).meta({ description: "Accepted actions: standard words or custom action names." }),
|
|
2870
|
+
extent: extentSchema
|
|
2871
|
+
})).default([]).meta({ description: "Grants of everyUser roles accepted as open to anyone." })
|
|
2872
|
+
}).optional().meta({ description: "What the self sign-up warning no longer reports: it names only objects and grants open to anyone that are not listed here." }),
|
|
2836
2873
|
scopeKinds: z.array(scopeKindSchema).default([]).meta({ description: "Scope kinds of the application; leave empty for a single-tenant application." }),
|
|
2837
2874
|
accessDimensions: z.array(accessDimensionSchema).default([]).meta({ description: "Access dimensions of the application: value catalogs that grants may restrict rows by." }),
|
|
2838
2875
|
membershipSources: z.array(membershipSourceSchema).default([]).meta({ description: "Adopted tables that hold the membership of a scope kind instead of a membership catalog." }),
|
|
@@ -2896,6 +2933,10 @@ const COMMAND_CORE_ERRORS = {
|
|
|
2896
2933
|
roleInUse: "role-in-use",
|
|
2897
2934
|
lastFullAccess: "last-full-access"
|
|
2898
2935
|
},
|
|
2936
|
+
invitationNotPending: {
|
|
2937
|
+
errcode: "P0001",
|
|
2938
|
+
message: "invitation.not-pending"
|
|
2939
|
+
},
|
|
2899
2940
|
conflict: {
|
|
2900
2941
|
errcode: "P0001",
|
|
2901
2942
|
message: "command.conflict",
|
|
@@ -2914,6 +2955,11 @@ const RIGHTS_REQUIRE_ERROR = {
|
|
|
2914
2955
|
message: "rights.forbidden",
|
|
2915
2956
|
noRight: "no-right"
|
|
2916
2957
|
};
|
|
2958
|
+
/**
|
|
2959
|
+
* The invitation acceptance function in the `simetra` schema (invitations
|
|
2960
|
+
* spec §5): T1 generates it, T3 calls it from `acceptInvitation`.
|
|
2961
|
+
*/
|
|
2962
|
+
const INVITATION_ACCEPT_FUNCTION_NAME = "invitation_accept";
|
|
2917
2963
|
/** Тригер ієрархії відмовляє поза `READ COMMITTED` (спека П4 §6.6). */
|
|
2918
2964
|
const HIERARCHY_ISOLATION_ERROR = {
|
|
2919
2965
|
errcode: "0A000",
|
|
@@ -2955,7 +3001,11 @@ const COMMAND_ERROR_CODES = [
|
|
|
2955
3001
|
"command.timeout",
|
|
2956
3002
|
"command.busy",
|
|
2957
3003
|
"command.stale-client",
|
|
2958
|
-
"command.internal"
|
|
3004
|
+
"command.internal",
|
|
3005
|
+
"invitation.invalid",
|
|
3006
|
+
"invitation.already-member",
|
|
3007
|
+
"invitation.rate-limited",
|
|
3008
|
+
"invitation.not-pending"
|
|
2959
3009
|
];
|
|
2960
3010
|
/**
|
|
2961
3011
|
* `reason` values a `CommandError` carries for envelope and size limits
|
|
@@ -3331,7 +3381,8 @@ const OBJECT_OPERATIONS = [
|
|
|
3331
3381
|
"markDeletion",
|
|
3332
3382
|
"delete",
|
|
3333
3383
|
"publish",
|
|
3334
|
-
"unpublish"
|
|
3384
|
+
"unpublish",
|
|
3385
|
+
"issueInvitation"
|
|
3335
3386
|
];
|
|
3336
3387
|
/**
|
|
3337
3388
|
* The object-module event an operation raises; `undefined` — none. Подію
|
|
@@ -3344,7 +3395,8 @@ const OPERATION_EVENTS = {
|
|
|
3344
3395
|
markDeletion: "write",
|
|
3345
3396
|
delete: void 0,
|
|
3346
3397
|
publish: "write",
|
|
3347
|
-
unpublish: "write"
|
|
3398
|
+
unpublish: "write",
|
|
3399
|
+
issueInvitation: void 0
|
|
3348
3400
|
};
|
|
3349
3401
|
const rowIdSchema = z.guid();
|
|
3350
3402
|
const expectedVersionSchema = z.int().min(1);
|
|
@@ -3460,6 +3512,11 @@ const operationSchema = z.discriminatedUnion("action", [
|
|
|
3460
3512
|
object: metadataRefSchema,
|
|
3461
3513
|
id: rowIdSchema,
|
|
3462
3514
|
expectedVersion: expectedVersionSchema
|
|
3515
|
+
}),
|
|
3516
|
+
z.strictObject({
|
|
3517
|
+
action: z.literal("issueInvitation"),
|
|
3518
|
+
object: metadataRefSchema,
|
|
3519
|
+
id: rowIdSchema
|
|
3463
3520
|
})
|
|
3464
3521
|
]);
|
|
3465
3522
|
/**
|
|
@@ -3474,6 +3531,19 @@ const BATCH_MAX = 500;
|
|
|
3474
3531
|
* `reason: "tabular-too-large"`.
|
|
3475
3532
|
*/
|
|
3476
3533
|
const batchSchema = lengthLimited(z.array(operationSchema).min(1), 500, LIMIT_REASONS.batchTooLarge);
|
|
3534
|
+
// src/model/runtime/result.ts
|
|
3535
|
+
/**
|
|
3536
|
+
* The result row of `issueInvitation` (invitations spec §4): a variant of the
|
|
3537
|
+
* operation's row, not a catalog row. The secret is shown here once and
|
|
3538
|
+
* nowhere else; `expiresAt` is the end of the invitation as the database
|
|
3539
|
+
* returned it.
|
|
3540
|
+
*/
|
|
3541
|
+
const invitationIssueSchema = z.strictObject({
|
|
3542
|
+
secret: z.string().regex(/^[A-Za-z0-9_-]{43}$/),
|
|
3543
|
+
expiresAt: z.string().min(1)
|
|
3544
|
+
});
|
|
3545
|
+
/** Whether a result row is the row of `issueInvitation`, not a catalog row. */
|
|
3546
|
+
const isInvitationIssue = (row) => invitationIssueSchema.safeParse(row).success;
|
|
3477
3547
|
// src/model/runtime/limits.ts
|
|
3478
3548
|
/**
|
|
3479
3549
|
* The most bytes a request body may carry (P4-B spec §4.5), measured by
|
|
@@ -3549,6 +3619,16 @@ const rightsDimensionValuesSchema = z.strictObject({
|
|
|
3549
3619
|
digest: versionEpochSchema.optional()
|
|
3550
3620
|
}).refine((d) => d.truncated === void 0 ? d.digest === void 0 : d.digest !== void 0 && d.values.length === 1e3, { message: "truncated carries a digest and exactly the cap of values" });
|
|
3551
3621
|
/**
|
|
3622
|
+
* Рядок `rights_container_held(<мітка>)` з міткою контейнерного об'єкта
|
|
3623
|
+
* (спека прав контейнера §1): контейнер, де актор має дієве контейнерне
|
|
3624
|
+
* призначення, і скоуп контейнера — `null` у нескоупленого.
|
|
3625
|
+
*/
|
|
3626
|
+
const rightsHeldContainerSchema = z.strictObject({
|
|
3627
|
+
object: z.string(),
|
|
3628
|
+
container: z.guid(),
|
|
3629
|
+
scope: z.guid().nullable()
|
|
3630
|
+
});
|
|
3631
|
+
/**
|
|
3552
3632
|
* Знімок прав поточного користувача (P4-B spec §9.1): лише його факти.
|
|
3553
3633
|
* Анонім і недійсний користувач — усі масиви порожні, `userId: null`.
|
|
3554
3634
|
*/
|
|
@@ -3560,6 +3640,7 @@ const rightsSnapshotSchema = z.strictObject({
|
|
|
3560
3640
|
})),
|
|
3561
3641
|
rights: z.array(rightsRowSchema),
|
|
3562
3642
|
members: z.array(rightsMemberSchema),
|
|
3643
|
+
heldContainers: z.array(rightsHeldContainerSchema),
|
|
3563
3644
|
dimensionValues: z.array(rightsDimensionValuesSchema)
|
|
3564
3645
|
});
|
|
3565
3646
|
/** `rightsVersion`: sha-256 канонічного JSON знімка, 64 hex. */
|
|
@@ -3574,6 +3655,11 @@ const rightsValueSchema = z.strictObject({
|
|
|
3574
3655
|
* кличе, а імпортує лише `simetra/model`.
|
|
3575
3656
|
*/
|
|
3576
3657
|
const RIGHTS_CLIENT_SNAPSHOT_FUNCTION_NAME = "rights_client_snapshot";
|
|
3658
|
+
/**
|
|
3659
|
+
* The function of my scopes in the `simetra` schema (rights spec §5.1): kind,
|
|
3660
|
+
* scope and my member. T1 generates it, T3 reads it for `workspaces`.
|
|
3661
|
+
*/
|
|
3662
|
+
const RIGHTS_MY_SCOPES_FUNCTION_NAME = "rights_my_scopes";
|
|
3577
3663
|
// src/model/runtime/keyset.ts
|
|
3578
3664
|
const isNullish = (value) => value === null || value === void 0;
|
|
3579
3665
|
const isNull = (attribute) => ({
|
|
@@ -3988,7 +4074,8 @@ const runtimeObjectSchema = catalogEntrySchema.extend({
|
|
|
3988
4074
|
markDeletion: runtimeOperationTargetSchema.optional(),
|
|
3989
4075
|
delete: runtimeOperationTargetSchema.optional(),
|
|
3990
4076
|
publish: runtimeOperationTargetSchema.optional(),
|
|
3991
|
-
unpublish: runtimeOperationTargetSchema.optional()
|
|
4077
|
+
unpublish: runtimeOperationTargetSchema.optional(),
|
|
4078
|
+
issueInvitation: runtimeOperationTargetSchema.optional()
|
|
3992
4079
|
}).optional(),
|
|
3993
4080
|
constraints: z.array(runtimeConstraintSchema)
|
|
3994
4081
|
}).superRefine((object, ctx) => {
|
|
@@ -4010,6 +4097,32 @@ const catalogAdoptedFactsSchema = z.strictObject({
|
|
|
4010
4097
|
membershipKinds: z.array(z.guid()),
|
|
4011
4098
|
assignments: z.literal(true).optional()
|
|
4012
4099
|
});
|
|
4100
|
+
/**
|
|
4101
|
+
* Рівень ролі в каталозі: `global`, `everyUser`, вид скоупу чи контейнер
|
|
4102
|
+
* (спека «Споживач поза монорепо» §5.4); вид і контейнер — за id.
|
|
4103
|
+
*/
|
|
4104
|
+
const catalogRoleLevelSchema = z.union([
|
|
4105
|
+
z.literal("global"),
|
|
4106
|
+
z.literal("everyUser"),
|
|
4107
|
+
z.strictObject({ scopeKind: z.string() }),
|
|
4108
|
+
z.strictObject({ container: z.string() })
|
|
4109
|
+
]);
|
|
4110
|
+
/** Роль у спільній частині каталогу: клієнт показує `title` чи `name`. */
|
|
4111
|
+
const catalogRoleSchema = z.strictObject({
|
|
4112
|
+
id: z.string(),
|
|
4113
|
+
name: z.string(),
|
|
4114
|
+
title: localizedStringSchema.optional(),
|
|
4115
|
+
level: catalogRoleLevelSchema,
|
|
4116
|
+
order: z.number().int().nonnegative().optional(),
|
|
4117
|
+
assignable: z.boolean(),
|
|
4118
|
+
fullAccess: z.boolean()
|
|
4119
|
+
});
|
|
4120
|
+
/** Набір прав у спільній частині каталогу. */
|
|
4121
|
+
const catalogRightsSetSchema = z.strictObject({
|
|
4122
|
+
id: z.string(),
|
|
4123
|
+
name: z.string(),
|
|
4124
|
+
title: localizedStringSchema.optional()
|
|
4125
|
+
});
|
|
4013
4126
|
/** The runtime catalog: a projection of the compiled model (P4 spec §6.3). */
|
|
4014
4127
|
const runtimeCatalogSchema = z.strictObject({
|
|
4015
4128
|
format: z.literal(1),
|
|
@@ -4019,10 +4132,25 @@ const runtimeCatalogSchema = z.strictObject({
|
|
|
4019
4132
|
rightsSnapshot: z.literal(true).optional(),
|
|
4020
4133
|
/** Проєкт дозволяє самореєстрацію: host відмовляє старту `open` без нього. */
|
|
4021
4134
|
selfSignUp: z.literal(true).optional(),
|
|
4135
|
+
/** Є вид скоупу із запрошеннями: T3 дозволяє `acceptInvitation` і `workspaces`. */
|
|
4136
|
+
invitations: z.literal(true).optional(),
|
|
4022
4137
|
adoptedFacts: catalogAdoptedFactsSchema.optional(),
|
|
4138
|
+
/** Немає в проєкті без ролей; порядок — за `order`, далі за `name`. */
|
|
4139
|
+
roles: z.array(catalogRoleSchema).optional(),
|
|
4140
|
+
rightsSets: z.array(catalogRightsSetSchema).optional(),
|
|
4023
4141
|
objects: z.array(runtimeObjectSchema)
|
|
4024
4142
|
}).superRefine((catalog, ctx) => {
|
|
4025
4143
|
catalog.objects.forEach((object, index) => {
|
|
4144
|
+
if (object.operations?.issueInvitation !== void 0 && (object.membership === void 0 || catalog.invitations !== true)) ctx.addIssue({
|
|
4145
|
+
code: "custom",
|
|
4146
|
+
path: [
|
|
4147
|
+
"objects",
|
|
4148
|
+
index,
|
|
4149
|
+
"operations",
|
|
4150
|
+
"issueInvitation"
|
|
4151
|
+
],
|
|
4152
|
+
message: "issueInvitation needs a membership catalog and the invitations flag"
|
|
4153
|
+
});
|
|
4026
4154
|
const membership = object.operations?.create?.root?.membership;
|
|
4027
4155
|
if (membership === void 0) return;
|
|
4028
4156
|
const target = catalog.objects.find((o) => o.id === membership);
|
|
@@ -4051,8 +4179,12 @@ const clientCatalogSchema = z.strictObject({
|
|
|
4051
4179
|
provider: z.enum(DATABASE_PROVIDERS),
|
|
4052
4180
|
/** Проєкт має функції прав: без прапорця клієнт не шле `rights` (Р6). */
|
|
4053
4181
|
rightsSnapshot: z.literal(true).optional(),
|
|
4182
|
+
/** Є вид скоупу із запрошеннями: клієнт показує видачу й прийняття. */
|
|
4183
|
+
invitations: z.literal(true).optional(),
|
|
4054
4184
|
/** Факти прийнятих джерел свіжіють за інтервалом (П4-B §8.2). */
|
|
4055
4185
|
adoptedFacts: catalogAdoptedFactsSchema.optional(),
|
|
4186
|
+
roles: z.array(catalogRoleSchema).optional(),
|
|
4187
|
+
rightsSets: z.array(catalogRightsSetSchema).optional(),
|
|
4056
4188
|
objects: z.array(catalogEntrySchema)
|
|
4057
4189
|
}).superRefine((catalog, ctx) => {
|
|
4058
4190
|
const ids = new Set(catalog.objects.map((o) => o.id));
|
|
@@ -5070,7 +5202,7 @@ function decodeRow(entry, raw, options = {}) {
|
|
|
5070
5202
|
*/
|
|
5071
5203
|
const wireObjectSchema = z.guid();
|
|
5072
5204
|
const wireTabularSectionsSchema = z.record(elementIdSchema, lengthLimited(z.array(z.record(z.string(), z.unknown())), TABULAR_LINES_MAX, LIMIT_REASONS.tabularTooLarge));
|
|
5073
|
-
const [createSchema, , markDeletionSchema, deleteSchema, publishSchema, unpublishSchema] = operationSchema.options;
|
|
5205
|
+
const [createSchema, , markDeletionSchema, deleteSchema, publishSchema, unpublishSchema, issueInvitationSchema] = operationSchema.options;
|
|
5074
5206
|
/** One operation of a command in wire form: object by UUID, physical columns. */
|
|
5075
5207
|
const wireOperationSchema = z.discriminatedUnion("action", [
|
|
5076
5208
|
createSchema.extend({
|
|
@@ -5084,7 +5216,8 @@ const wireOperationSchema = z.discriminatedUnion("action", [
|
|
|
5084
5216
|
markDeletionSchema.extend({ object: wireObjectSchema }),
|
|
5085
5217
|
deleteSchema.extend({ object: wireObjectSchema }),
|
|
5086
5218
|
publishSchema.extend({ object: wireObjectSchema }),
|
|
5087
|
-
unpublishSchema.extend({ object: wireObjectSchema })
|
|
5219
|
+
unpublishSchema.extend({ object: wireObjectSchema }),
|
|
5220
|
+
issueInvitationSchema.extend({ object: wireObjectSchema })
|
|
5088
5221
|
]);
|
|
5089
5222
|
/**
|
|
5090
5223
|
* A command error in wire form: `object` by UUID; `path` and `attributes`
|
|
@@ -5199,6 +5332,31 @@ const wireRunResultSchema = z.strictObject({
|
|
|
5199
5332
|
changes: z.array(wireChangeSchema),
|
|
5200
5333
|
epoch: versionEpochSchema
|
|
5201
5334
|
});
|
|
5335
|
+
/**
|
|
5336
|
+
* The run result checked against the operations of its request (invitations
|
|
5337
|
+
* spec §4): the row of an `issueInvitation` must be an `InvitationIssue` and
|
|
5338
|
+
* must be present (the response budget never cuts it); a row of any other
|
|
5339
|
+
* operation must not be shaped like one. Messages carry no value, so a
|
|
5340
|
+
* refused secret does not reach an error text.
|
|
5341
|
+
*/
|
|
5342
|
+
function wireRunResultFor(operations) {
|
|
5343
|
+
return wireRunResultSchema.superRefine((result, ctx) => {
|
|
5344
|
+
operations.forEach((op, i) => {
|
|
5345
|
+
const row = result.rows?.[i];
|
|
5346
|
+
const issue = op.action === "issueInvitation";
|
|
5347
|
+
if (issue && !invitationIssueSchema.safeParse(row).success) ctx.addIssue({
|
|
5348
|
+
code: "custom",
|
|
5349
|
+
path: ["rows", i],
|
|
5350
|
+
message: "the row of issueInvitation must be { secret, expiresAt }"
|
|
5351
|
+
});
|
|
5352
|
+
else if (!issue && invitationIssueSchema.safeParse(row).success) ctx.addIssue({
|
|
5353
|
+
code: "custom",
|
|
5354
|
+
path: ["rows", i],
|
|
5355
|
+
message: "only issueInvitation returns an invitation row"
|
|
5356
|
+
});
|
|
5357
|
+
});
|
|
5358
|
+
});
|
|
5359
|
+
}
|
|
5202
5360
|
/** The catalog version a `version` part returns. */
|
|
5203
5361
|
const versionValueSchema = z.strictObject({
|
|
5204
5362
|
snapshotHash: z.string(),
|
|
@@ -8702,4 +8860,4 @@ const ASSIGNED_ONCE = [
|
|
|
8702
8860
|
field: "primaryDataLanguage"
|
|
8703
8861
|
}
|
|
8704
8862
|
];
|
|
8705
|
-
export { APPLIED_SNAPSHOT_HASH_FUNCTION_NAME, ASSIGNED_ONCE, ATTRIBUTE_CASES, BATCH_MAX, CAST_TYPES, CENTRIFUGO_CHANNEL_MAX, COMMAND_CORE_ERRORS, COMMAND_ERROR_CODES, COMMAND_SETTING, CURRENT_USER_FUNCTION_NAME, CommandFailure, DATABASE_PROVIDERS, DEFAULT_MAIN_PRESENTATION, DEFAULT_SEARCH_MODE, DELETE_EVENTS, ELEMENT_ID_SEPARATOR, FILTER_DEPTH_MAX, FILTER_IN_MAX, FILTER_NODES_MAX, FILTER_OPERATORS, FUNCTIONS_FILE_SUFFIX, HEAD_READABLE_SETTINGS, HIERARCHY_ISOLATION_ERROR, INCLUDE_MAX, INTEGER_TEXT, JSONB_PAIRS_PER_CALL, KIND_REGISTRY, KNOWN_MARKER, LIMIT_REASONS, LOGICAL_TYPES, LOGIN_ROLE_PARENTS, LOGIN_ROLE_REQUEST_PURPOSES, LOGIN_ROLE_SETTINGS, MAX_PHYSICAL_NAME_BYTES, MEMBERSHIP_SET_FUNCTION, METADATA_KINDS, NO_SCOPE, OBJECT_MODULE_KEYS, OBJECT_OPERATIONS, OPERATION_EVENTS, ORDER_BY_MAX, PAYLOAD_MAX_BYTES, PINNED_SESSION_SETTINGS, PLATFORM_LOGIN_ROLES, PLATFORM_ROLES, PLATFORM_ROLES_NOT_PURPOSES, PLATFORM_SCHEMA, PLATFORM_SETTING_PREFIX, PLATFORM_STATE_TABLES, PRIVILEGED_LOGIN_REASONS, PROJECT_KEY_ORDER, PROTECTED_SESSION_SETTINGS, PROVIDER_API_ROLES, PROVIDER_EVENT_SOURCES, PROVIDER_EXPRESSION_FUNCTIONS, PROVIDER_FUNCTIONS, PROVIDER_IDENTITY_SOURCES, PROVIDER_LOGIN_ROLES, PROVIDER_OWNER_ROLES, PROVIDER_SCHEMAS, PUBLIC_READ_PURPOSES, PUBLIC_READ_ROLES, READ_BATCH_MAX, READ_BATCH_STATEMENTS_MAX, READ_COUNT_CAP, READ_LIMIT_MAX, READ_OFFSET_MAX, RESPONSE_BUDGET_BYTES, RICH_TEXT_MAX_DEPTH, RICH_TEXT_PROFILE, RICH_TEXT_WHITESPACE, RIGHTS_CLIENT_SNAPSHOT_FUNCTION_NAME, RIGHTS_COLUMNS, RIGHTS_DELTA_SECTION, RIGHTS_DIMENSION_VALUES_MAX, RIGHTS_MAINTENANCE_SETTING, RIGHTS_REQUIRE_ERROR, ROW_VERSION_EPOCH_FUNCTION_NAME, SCHEMA_RULES, SEARCH_MODES, SEARCH_PREFIX_CHARS, SESSION_CLAIMS_SETTING, SIGNAL_INVALIDATE_FUNCTION_NAME, SIGNAL_MERGE_MODE, SIGNAL_MERGE_THRESHOLD, SIGNAL_MODE_SETTING, SIGNAL_NOTIFY_CHANNEL, SIGNAL_OUTBOX, SIGNAL_PAYLOAD_MAX_BYTES, SIGNAL_TOPIC_ALLOWED_FUNCTION_NAME, SQL_DEBT_FILE, SQL_FUNCTION_CALLERS, SQL_UNIT_CLASSES, STANDARD_ACTIONS, STORAGE_ERRORS, STORAGE_FUNCTIONS, STORAGE_MAX_BYTES, STORAGE_REASONS, STORAGE_TABLES, STRUCTURAL_PATH_WORDS, SUBSCRIPTION_EVENTS, TABULAR_LINES_MAX, TOPIC_UUID_PATTERN, USER_PLATFORM_COLUMNS, UUID_TEXT, VALUE_REASONS, WireDecodeError, WireEncodeError, ZERO_UUID, accessDimensionSchema, accessMappingSchema, accessSchema, accumulationRegisterSchema, actionRequires, appSchemaNameSchema, assignPhysicalName, assignedOnSchema, assignmentSourceSchema, attributeSchema, authorColumns, batchSchema, castTypeSchema, catalogAdoptedFactsSchema, catalogAttributeSchema, catalogEntryAttributeSchema, catalogEntrySchema, catalogEntrySectionSchema, catalogFromSnapshot, catalogIndex, catalogRightsCarrierSchema, catalogRightsExtentSchema, catalogRightsSchema, catalogRightsSubjectSchema, catalogSchema, changeSignalSchema, changesFromWire, changesToWire, channelTopic, checkRichText, chooseConstraintName, clientCatalogSchema, clipBytes, closeRequires, compositeIndexesSchema, constantSchema, customActionSchema, customActionsSchema, customTableColumnSchema, customTableSchema, dataRequestSchema, dataResponseSchema, decodeRow, decodeValues, defaultMayRepeat, defaultViolatesValueChecks, defineObjectModule, deletionMarkColumn, diffCatalogModels, documentSchema, effectiveMaxBytes, effectiveSearch, elementIdSchema, elementNameSchema, encodeAttributeValue, encodeAttributes, encodeItemValue, encodePair, encodeRow, enumValueSchema, enumerationSchema, errorFromWire, errorToWire, eventSubscriptionSchema, expectsKindLabel, extentSchema, fileObjectKey, filePlatformColumns, filterSchema, filterWithinLimits, formatMetaFile, formatProjectFile, formatSqlDebtFile, formatSqlFunctionsFile, grantEntryForm, grantEntrySchema, includeSchema, informationRegisterSchema, invalidateSignalSchema, isDate, isDateTime, isFileObjectKey, isFileObjectPrefix, isObjectOrigin, isObjectTable, isPlainObject, isRecordKeyAt, isRichTextEmpty, isScalarDefault, isSqlReservedWord, isTextEncodedType, isUuidColumn, isWithinType, jsonBytes, jsonbBuildObject, kernelHashSchema, keyColumn, keysetFilter, keysetNodesMax, kindByDir, knownFormAllowed, knownSchema, lengthLimited, lineNumberColumn, localizedStringSchema, logicalElementName, logicalObjectName, logicalTypeOf, loginRoleParentNames, makeObjectName, matchesAttributeCase, membershipSourceSchema, metadataIdSchema, metadataKindSchema, metadataRefSchema, monthColumn, namedCollections, normalDateTime, objectColumns, objectHeaderShape, objectNameSchema, objectSelectorSchema, objectTable, operationFromWire, operationSchema, operationToWire, orderBySchema, ownershipSchema, parseExpression, parsePublicRead, parseStandardElementId, parseTopic, pathFromWire, pathToWire, pgEnumSchema, pgEnumTypeName, pgTypeOf, physicalNameSchema, postsMovements, predefinedNameColumn, projectSchema, publicReadConditionalSchema, publicReadSchema, publicationCarriers, publishedColumn, qualifiedNameSchema, queryFormSchema, quoteIdent, readPartFromWire, readPartToWire, readQueryFromWire, readQuerySchema, readQueryToWire, readResultFromWire, readResultToWire, receivedChangeSchema, receivedInvalidateSchema, receivedRightsSchema, refineValueType, resourceSchema, richTextDepthOk, rightsCarrierSchema, rightsDimensionValuesSchema, rightsMemberSchema, rightsRowSchema, rightsSetSchema, rightsSignalSchema, rightsSnapshotSchema, rightsValueSchema, rightsVersionSchema, roleAssignedOnSchema, roleSchema, rowWithoutSearch, runtimeAttributeSchema, runtimeCatalogSchema, runtimeConstraintSchema, runtimeObjectSchema, runtimeOperationTargetSchema, runtimeRootCreateSchema, runtimeSectionSchema, scopeKindSchema, searchColumnName, searchNormalization, searchPrefixNormalization, searchSchema, serviceDateColumns, sessionClaimsSchema, setGrantEntrySchema, singleUuidKeyColumn, singletonColumn, sourceConditionSchema, splitKnownMarker, sqlDebtSchema, sqlFunctionDeclarationSchema, sqlFunctionsFileSchema, standardAttributeOverridesSchema, standardElementId, standardLogicalName, storageSchema, tabularParentColumn, tabularSectionSchema, toSnakeCase, truncatedPeriodExpression, updateOperationObjectSchema, userPlatformColumns, valueTypeShape, versionColumn, versionEpochSchema, versionValueSchema, walkExpr, wireChangeSchema, wireCommandErrorSchema, wireOperationSchema, wireReadPartSchema, wireReadPartsResultSchema, wireReadQuerySchema, wireReadResultSchema, wireRunResultSchema };
|
|
8863
|
+
export { APPLIED_SNAPSHOT_HASH_FUNCTION_NAME, ASSIGNED_ONCE, ATTRIBUTE_CASES, BATCH_MAX, CAST_TYPES, CENTRIFUGO_CHANNEL_MAX, COMMAND_CORE_ERRORS, COMMAND_ERROR_CODES, COMMAND_SETTING, CURRENT_USER_FUNCTION_NAME, CommandFailure, DATABASE_PROVIDERS, DEFAULT_MAIN_PRESENTATION, DEFAULT_SEARCH_MODE, DELETE_EVENTS, ELEMENT_ID_SEPARATOR, FILTER_DEPTH_MAX, FILTER_IN_MAX, FILTER_NODES_MAX, FILTER_OPERATORS, FUNCTIONS_FILE_SUFFIX, HEAD_READABLE_SETTINGS, HIERARCHY_ISOLATION_ERROR, INCLUDE_MAX, INTEGER_TEXT, INVITATION_ACCEPT_FUNCTION_NAME, JSONB_PAIRS_PER_CALL, KIND_REGISTRY, KNOWN_MARKER, LIMIT_REASONS, LOGICAL_TYPES, LOGIN_ROLE_PARENTS, LOGIN_ROLE_REQUEST_PURPOSES, LOGIN_ROLE_SETTINGS, MAX_PHYSICAL_NAME_BYTES, MEMBERSHIP_SET_FUNCTION, METADATA_KINDS, NO_SCOPE, OBJECT_MODULE_KEYS, OBJECT_OPERATIONS, OPERATION_EVENTS, ORDER_BY_MAX, PAYLOAD_MAX_BYTES, PINNED_SESSION_SETTINGS, PLATFORM_ACTIONS, PLATFORM_LOGIN_ROLES, PLATFORM_ROLES, PLATFORM_ROLES_NOT_PURPOSES, PLATFORM_SCHEMA, PLATFORM_SETTING_PREFIX, PLATFORM_STATE_TABLES, PRIVILEGED_LOGIN_REASONS, PROJECT_KEY_ORDER, PROTECTED_SESSION_SETTINGS, PROVIDER_API_ROLES, PROVIDER_EVENT_SOURCES, PROVIDER_EXPRESSION_FUNCTIONS, PROVIDER_FUNCTIONS, PROVIDER_IDENTITY_SOURCES, PROVIDER_LOGIN_ROLES, PROVIDER_OWNER_ROLES, PROVIDER_SCHEMAS, PUBLIC_READ_PURPOSES, PUBLIC_READ_ROLES, READ_BATCH_MAX, READ_BATCH_STATEMENTS_MAX, READ_COUNT_CAP, READ_LIMIT_MAX, READ_OFFSET_MAX, RESPONSE_BUDGET_BYTES, RICH_TEXT_MAX_DEPTH, RICH_TEXT_PROFILE, RICH_TEXT_WHITESPACE, RIGHTS_CLIENT_SNAPSHOT_FUNCTION_NAME, RIGHTS_COLUMNS, RIGHTS_DELTA_SECTION, RIGHTS_DIMENSION_VALUES_MAX, RIGHTS_MAINTENANCE_SETTING, RIGHTS_MY_SCOPES_FUNCTION_NAME, RIGHTS_REQUIRE_ERROR, ROW_VERSION_EPOCH_FUNCTION_NAME, SCHEMA_RULES, SEARCH_MODES, SEARCH_PREFIX_CHARS, SESSION_CLAIMS_SETTING, SIGNAL_INVALIDATE_FUNCTION_NAME, SIGNAL_MERGE_MODE, SIGNAL_MERGE_THRESHOLD, SIGNAL_MODE_SETTING, SIGNAL_NOTIFY_CHANNEL, SIGNAL_OUTBOX, SIGNAL_PAYLOAD_MAX_BYTES, SIGNAL_TOPIC_ALLOWED_FUNCTION_NAME, SQL_DEBT_FILE, SQL_FUNCTION_CALLERS, SQL_UNIT_CLASSES, STANDARD_ACTIONS, STORAGE_ERRORS, STORAGE_FUNCTIONS, STORAGE_MAX_BYTES, STORAGE_REASONS, STORAGE_TABLES, STRUCTURAL_PATH_WORDS, SUBSCRIPTION_EVENTS, TABULAR_LINES_MAX, TOPIC_UUID_PATTERN, USER_PLATFORM_COLUMNS, UUID_TEXT, VALUE_REASONS, WireDecodeError, WireEncodeError, ZERO_UUID, acceptInvitationAction, accessDimensionSchema, accessMappingSchema, accessSchema, accumulationRegisterSchema, actionRequires, appSchemaNameSchema, assignPhysicalName, assignedOnSchema, assignmentSourceSchema, attributeSchema, authorColumns, batchSchema, castTypeSchema, catalogAdoptedFactsSchema, catalogAttributeSchema, catalogEntryAttributeSchema, catalogEntrySchema, catalogEntrySectionSchema, catalogFromSnapshot, catalogIndex, catalogRightsCarrierSchema, catalogRightsExtentSchema, catalogRightsSchema, catalogRightsSetSchema, catalogRightsSubjectSchema, catalogRoleLevelSchema, catalogRoleSchema, catalogSchema, changeSignalSchema, changesFromWire, changesToWire, channelTopic, checkRichText, chooseConstraintName, clientCatalogSchema, clipBytes, closeRequires, compositeIndexesSchema, constantSchema, containerBindingSchema, customActionSchema, customActionsSchema, customTableColumnSchema, customTableSchema, dataRequestSchema, dataResponseSchema, decodeRow, decodeValues, defaultMayRepeat, defaultViolatesValueChecks, defineObjectModule, deletionMarkColumn, diffCatalogModels, documentSchema, effectiveMaxBytes, effectiveSearch, elementIdSchema, elementNameSchema, encodeAttributeValue, encodeAttributes, encodeItemValue, encodePair, encodeRow, enumValueSchema, enumerationSchema, errorFromWire, errorToWire, eventSubscriptionSchema, expectsKindLabel, extentSchema, fileObjectKey, filePlatformColumns, filterSchema, filterWithinLimits, formatMetaFile, formatProjectFile, formatSqlDebtFile, formatSqlFunctionsFile, grantEntryForm, grantEntrySchema, includeSchema, informationRegisterSchema, invalidateSignalSchema, invitationIssueSchema, isDate, isDateTime, isFileObjectKey, isFileObjectPrefix, isInvitationIssue, isObjectOrigin, isObjectTable, isPlainObject, isRecordKeyAt, isRichTextEmpty, isScalarDefault, isSqlReservedWord, isTextEncodedType, isUuidColumn, isWithinType, jsonBytes, jsonbBuildObject, kernelHashSchema, keyColumn, keysetFilter, keysetNodesMax, kindByDir, knownFormAllowed, knownSchema, lengthLimited, lineNumberColumn, localizedStringSchema, logicalElementName, logicalObjectName, logicalTypeOf, loginRoleParentNames, makeObjectName, matchesAttributeCase, membershipSourceSchema, metadataIdSchema, metadataKindSchema, metadataRefSchema, monthColumn, namedCollections, normalDateTime, objectColumns, objectHeaderShape, objectNameSchema, objectSelectorSchema, objectTable, operationFromWire, operationSchema, operationToWire, orderBySchema, ownershipSchema, parseExpression, parsePublicRead, parseStandardElementId, parseTopic, pathFromWire, pathToWire, pgEnumSchema, pgEnumTypeName, pgTypeOf, physicalNameSchema, postsMovements, predefinedNameColumn, projectSchema, publicReadConditionalSchema, publicReadSchema, publicationCarriers, publishedColumn, qualifiedNameSchema, queryFormSchema, quoteIdent, readPartFromWire, readPartToWire, readQueryFromWire, readQuerySchema, readQueryToWire, readResultFromWire, readResultToWire, receivedChangeSchema, receivedInvalidateSchema, receivedRightsSchema, refineValueType, resourceSchema, richTextDepthOk, rightsCarrierSchema, rightsDimensionValuesSchema, rightsHeldContainerSchema, rightsMemberSchema, rightsRowSchema, rightsSetSchema, rightsSignalSchema, rightsSnapshotSchema, rightsValueSchema, rightsVersionSchema, roleAssignedOnSchema, roleSchema, rowWithoutSearch, runtimeAttributeSchema, runtimeCatalogSchema, runtimeConstraintSchema, runtimeObjectSchema, runtimeOperationTargetSchema, runtimeRootCreateSchema, runtimeSectionSchema, scopeKindSchema, searchColumnName, searchNormalization, searchPrefixNormalization, searchSchema, serviceDateColumns, sessionClaimsSchema, setGrantEntrySchema, singleUuidKeyColumn, singletonColumn, sourceConditionSchema, splitKnownMarker, sqlDebtSchema, sqlFunctionDeclarationSchema, sqlFunctionsFileSchema, standardAttributeOverridesSchema, standardElementId, standardLogicalName, storageSchema, tabularParentColumn, tabularSectionSchema, toSnakeCase, truncatedPeriodExpression, updateOperationObjectSchema, userPlatformColumns, valueTypeShape, versionColumn, versionEpochSchema, versionValueSchema, walkExpr, wireChangeSchema, wireCommandErrorSchema, wireOperationSchema, wireReadPartSchema, wireReadPartsResultSchema, wireReadQuerySchema, wireReadResultSchema, wireRunResultFor, wireRunResultSchema };
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1021,7 +1021,7 @@ export declare function checkOwnerAttributes(tx: ApplyTransaction, provider: Dat
|
|
|
1021
1021
|
* тримає тест, а не читання маніфесту під час виконання: ярус не звертається
|
|
1022
1022
|
* до файлової системи.
|
|
1023
1023
|
*/
|
|
1024
|
-
export declare const PLATFORM_VERSION = "0.3.0-next.
|
|
1024
|
+
export declare const PLATFORM_VERSION = "0.3.0-next.11";
|
|
1025
1025
|
/**
|
|
1026
1026
|
* Структурний ключ таблиці для множин і мап: ім'я з крапкою не злипається зі
|
|
1027
1027
|
* схемою, як злиплося б у `schema.name`. Складені ключі підоб'єктів — так
|
|
@@ -2080,10 +2080,19 @@ export declare function readBlindFunctions(tx: ApplyTransaction, plpgsqlCheck: "
|
|
|
2080
2080
|
export declare const PLPGSQL_CHECK_MODES: readonly ["installed", "transient", "unavailable"];
|
|
2081
2081
|
type PlpgsqlCheckMode = (typeof PLPGSQL_CHECK_MODES)[number];
|
|
2082
2082
|
/**
|
|
2083
|
-
*
|
|
2084
|
-
*
|
|
2083
|
+
* Whether `plpgsql_check` is in `pg_extension` of this database (whatever
|
|
2084
|
+
* rights the role has on it) and whether the server offers it in
|
|
2085
|
+
* `pg_available_extensions`.
|
|
2085
2086
|
*/
|
|
2086
|
-
|
|
2087
|
+
interface PlpgsqlCheckPresence {
|
|
2088
|
+
installed: boolean;
|
|
2089
|
+
available: boolean;
|
|
2090
|
+
}
|
|
2091
|
+
/**
|
|
2092
|
+
* Наявність розширення незалежно від прав ролі на нього: звірка цілі з планом
|
|
2093
|
+
* питає лише, чи воно є в базі й чи сервер його пропонує.
|
|
2094
|
+
*/
|
|
2095
|
+
export declare function readPlpgsqlCheckPresence(tx: ApplyTransaction): Promise<PlpgsqlCheckPresence>;
|
|
2087
2096
|
/** Режим `plpgsql_check` цієї бази; `installable` — перелік пресету провайдера. */
|
|
2088
2097
|
export declare function readPlpgsqlCheckMode(tx: ApplyTransaction, installable: readonly string[]): Promise<PlpgsqlCheckMode>;
|
|
2089
2098
|
/**
|
|
@@ -3292,6 +3301,16 @@ interface PostgresClusterSet {
|
|
|
3292
3301
|
name: string;
|
|
3293
3302
|
};
|
|
3294
3303
|
}
|
|
3304
|
+
/**
|
|
3305
|
+
* Options of `ensurePostgresCluster`. `passwords` maps a login role of the set
|
|
3306
|
+
* (the owner, `auth` or a login role of `roles`) to the password that the
|
|
3307
|
+
* call sets on it, in the same transaction, only when the call creates that
|
|
3308
|
+
* role: an existing role keeps its password. The values never reach the
|
|
3309
|
+
* outcome or a diagnostic.
|
|
3310
|
+
*/
|
|
3311
|
+
interface PostgresClusterOptions {
|
|
3312
|
+
passwords?: ReadonlyMap<string, string>;
|
|
3313
|
+
}
|
|
3295
3314
|
/**
|
|
3296
3315
|
* What a call created, what it only found, and what it could not do yet.
|
|
3297
3316
|
* Roles and databases by name; the identity grants as `<schema>:USAGE` and
|
|
@@ -3309,6 +3328,8 @@ interface PostgresClusterOutcome {
|
|
|
3309
3328
|
role: string;
|
|
3310
3329
|
parents: string[];
|
|
3311
3330
|
}[];
|
|
3331
|
+
/** Created login roles that got a password from `passwords`; absent when none. */
|
|
3332
|
+
passwords?: string[];
|
|
3312
3333
|
}
|
|
3313
3334
|
/** Result of `ensurePostgresCluster`: nothing was written when it is a refusal. */
|
|
3314
3335
|
type PostgresClusterResult = {
|
|
@@ -3349,9 +3370,10 @@ interface ClusterConnections {
|
|
|
3349
3370
|
* Фаза читання нічого не пише й збирає всі відмови; фаза запису не відмовляє
|
|
3350
3371
|
* вибірково (окрім повторної перевірки `extensions` перед
|
|
3351
3372
|
* `CREATE EXTENSION`) і діє за знімком читання. Повторний виклик нічого не
|
|
3352
|
-
* створює.
|
|
3373
|
+
* створює. Розширення, якого сервер не пропонує, — відмова фази читання
|
|
3374
|
+
* `roles.extension-unavailable`, а не сира помилка `CREATE EXTENSION`.
|
|
3353
3375
|
*/
|
|
3354
|
-
export declare function ensurePostgresCluster(dbs: ApplyDatabase, conns: ClusterConnections, set: PostgresClusterSet): Promise<PostgresClusterResult>;
|
|
3376
|
+
export declare function ensurePostgresCluster(dbs: ApplyDatabase, conns: ClusterConnections, set: PostgresClusterSet, options?: PostgresClusterOptions): Promise<PostgresClusterResult>;
|
|
3355
3377
|
/** One maintenance action of the `rights-maintenance` tool (P4 spec §6.12). */
|
|
3356
3378
|
type RightsMaintenanceRequest = {
|
|
3357
3379
|
action: "firstGlobalAssignment";
|
|
@@ -4021,4 +4043,4 @@ interface StepChange {
|
|
|
4021
4043
|
* більше за `unproven`.
|
|
4022
4044
|
*/
|
|
4023
4045
|
export declare function planChange(steps: readonly Pick<PlanStep, "id" | "sql" | "verb" | "produced" | "destroyed" | "consumed">[], used: UsedObject, parse: SqlParser): StepChange | undefined;
|
|
4024
|
-
export type { AccessChange, AppliedCatalog, ApplyDatabase, ApplyDesired, ApplyRecord, ApplyState, ApplyStateObjects, ApplyTimeouts, ApplyTransaction, BackfillAction, BackfillCounts, BackfillFacts, BackfillInput, BackfillResult, BackfillTarget, BlindFunctions, CanonicalRename, CatalogFingerprint, CensusClass, CensusCount, CheckResult, ClassCoverage, ColumnName, CreatedByPlan, DataFacts, DataOrigin, DataStepKind, DataTable, DataWriter, DbConnection, DesiredComparison, DesiredState, DriftReport, DriftVerdict, EngineAction, EngineCatalog, EngineCoverage, EngineDiagnostic, EngineIdentity, EngineObjectRef, EnginePlan, EngineScope, EngineSetting, EquivalenceObject, ExecutablePlan, ExecuteAclEntry, ExecuteCrossCheckFailure, ExecuteFacts, ExecuteOptions, ExecuteOutcome, Extracted, FingerprintComparison, FingerprintSection, FolderReference, FootprintModels, FunctionError, FunctionExecuteFact, GlobalDefaultPrivilege, GuardForm, GuardProblem, GuardResult, IdentityTableFacts, ImplicitLock, LiveForeignKey, LiveTrigger, LockedTable, MarkerRecord, ModelScope, NotNullColumn, OwnerRefusalCode, ParsedPlan, PendingCarrierCopies, PermissionItem, PermissionSubject, PlanAction, PlanArtifact, PlanDatabases, PlanOutcome, PlanStep, PlannedDataTable, PlatformLoginRole, PlatformRoleOutcome, PlatformRoleRow, PlatformRoleSet, PlpgsqlCheckMode, PostgresClusterOutcome, PostgresClusterResult, PostgresClusterSet, PreservedTable, PromotionInput, PromotionSection, PropertyCount, ProviderLockSet, ProviderLockSource, ProviderLockStatement, ProviderLocks, ProviderSurface, ProviderTableName, RehearsalEvidence, RehearsalPhase, RehearsalProof, RehearsalReport, RehearsalTimings, Removal, RemovalCover, RenameIntent, RenderedStatement, ReverseOptions, ReverseResult, RightsMaintenanceDone, RightsMaintenanceRequest, RightsOrphans, RoleServer, SchemaEngine, SectionTable, SeedTargetRows, SeedVerdict, ServerFacts, ShadowEnvironment, ShadowOptions, ShadowOutcome, StatementSubject, StepChange, StepClass, StepFootprint, TableLock, TableLockMode, TransitionVerdict, TypeChange, TypeChangeDependent, TypePresence, UsedObject, WriteFacts, WritePath, WriteTable };
|
|
4046
|
+
export type { AccessChange, AppliedCatalog, ApplyDatabase, ApplyDesired, ApplyRecord, ApplyState, ApplyStateObjects, ApplyTimeouts, ApplyTransaction, BackfillAction, BackfillCounts, BackfillFacts, BackfillInput, BackfillResult, BackfillTarget, BlindFunctions, CanonicalRename, CatalogFingerprint, CensusClass, CensusCount, CheckResult, ClassCoverage, ColumnName, CreatedByPlan, DataFacts, DataOrigin, DataStepKind, DataTable, DataWriter, DbConnection, DesiredComparison, DesiredState, DriftReport, DriftVerdict, EngineAction, EngineCatalog, EngineCoverage, EngineDiagnostic, EngineIdentity, EngineObjectRef, EnginePlan, EngineScope, EngineSetting, EquivalenceObject, ExecutablePlan, ExecuteAclEntry, ExecuteCrossCheckFailure, ExecuteFacts, ExecuteOptions, ExecuteOutcome, Extracted, FingerprintComparison, FingerprintSection, FolderReference, FootprintModels, FunctionError, FunctionExecuteFact, GlobalDefaultPrivilege, GuardForm, GuardProblem, GuardResult, IdentityTableFacts, ImplicitLock, LiveForeignKey, LiveTrigger, LockedTable, MarkerRecord, ModelScope, NotNullColumn, OwnerRefusalCode, ParsedPlan, PendingCarrierCopies, PermissionItem, PermissionSubject, PlanAction, PlanArtifact, PlanDatabases, PlanOutcome, PlanStep, PlannedDataTable, PlatformLoginRole, PlatformRoleOutcome, PlatformRoleRow, PlatformRoleSet, PlpgsqlCheckMode, PlpgsqlCheckPresence, PostgresClusterOptions, PostgresClusterOutcome, PostgresClusterResult, PostgresClusterSet, PreservedTable, PromotionInput, PromotionSection, PropertyCount, ProviderLockSet, ProviderLockSource, ProviderLockStatement, ProviderLocks, ProviderSurface, ProviderTableName, RehearsalEvidence, RehearsalPhase, RehearsalProof, RehearsalReport, RehearsalTimings, Removal, RemovalCover, RenameIntent, RenderedStatement, ReverseOptions, ReverseResult, RightsMaintenanceDone, RightsMaintenanceRequest, RightsOrphans, RoleServer, SchemaEngine, SectionTable, SeedTargetRows, SeedVerdict, ServerFacts, ShadowEnvironment, ShadowOptions, ShadowOutcome, StatementSubject, StepChange, StepClass, StepFootprint, TableLock, TableLockMode, TransitionVerdict, TypeChange, TypeChangeDependent, TypePresence, UsedObject, WriteFacts, WritePath, WriteTable };
|