@foir/sdk 0.18.0 → 0.20.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.
@@ -2,9 +2,8 @@
2
2
  // @generated from file apps/v1/apps.proto (package apps.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
 
5
- import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
5
+ import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
6
6
  import type { JsonObject, Message } from "@bufbuild/protobuf";
7
- import type { EnumValueOptions } from "@bufbuild/protobuf/wkt";
8
7
 
9
8
  /**
10
9
  * Describes the file apps/v1/apps.proto.
@@ -234,6 +233,22 @@ export declare type Feature = Message<"apps.v1.Feature"> & {
234
233
  * @generated from field: bool customer_sign_in = 6;
235
234
  */
236
235
  customerSignIn: boolean;
236
+
237
+ /**
238
+ * The notification category the feature sends under, when it sends
239
+ * notifications. See FeatureNotificationCategory.
240
+ *
241
+ * @generated from field: apps.v1.FeatureNotificationCategory notification_category = 7;
242
+ */
243
+ notificationCategory?: FeatureNotificationCategory | undefined;
244
+
245
+ /**
246
+ * The notification category the feature keeps consent in, when it reads or
247
+ * writes what a customer chose. See FeatureConsentCategory.
248
+ *
249
+ * @generated from field: apps.v1.FeatureConsentCategory consent_category = 8;
250
+ */
251
+ consentCategory?: FeatureConsentCategory | undefined;
237
252
  };
238
253
 
239
254
  /**
@@ -242,6 +257,141 @@ export declare type Feature = Message<"apps.v1.Feature"> & {
242
257
  */
243
258
  export declare const FeatureSchema: GenMessage<Feature>;
244
259
 
260
+ /**
261
+ * The notification category a feature sends under.
262
+ *
263
+ * A project that declares notification categories takes every notification
264
+ * under one of them, so that what a customer chose about a category is
265
+ * honoured. An app that sends has to be given one the project has, and nobody
266
+ * should have to type its key to do that. So the feature says which of the
267
+ * app's settings holds the key, and proposes the category it would send under.
268
+ * The setup offers the project's own categories and the proposed one, makes the
269
+ * proposed one where the operator chooses it, and writes the chosen key to the
270
+ * setting. The app reads the setting and names that key on every send.
271
+ *
272
+ * The platform holds the setting to that: while the feature is on at a running
273
+ * install it names a category the install's level is served, or, at a level
274
+ * served none, the proposed key, which is made a category of that level
275
+ * together with its first.
276
+ *
277
+ * @generated from message apps.v1.FeatureNotificationCategory
278
+ */
279
+ export declare type FeatureNotificationCategory = Message<"apps.v1.FeatureNotificationCategory"> & {
280
+ /**
281
+ * REQUIRED. The string property of settings_schema that holds the key.
282
+ *
283
+ * @generated from field: string setting = 1;
284
+ */
285
+ setting: string;
286
+
287
+ /**
288
+ * REQUIRED. The key of the category the app proposes: what the category is
289
+ * called in the project's API. Letters, digits and underscores, starting
290
+ * with a letter.
291
+ *
292
+ * @generated from field: string key = 2;
293
+ */
294
+ key: string;
295
+
296
+ /**
297
+ * REQUIRED. What the category is called to an operator and to a customer.
298
+ *
299
+ * @generated from field: string name = 3;
300
+ */
301
+ name: string;
302
+
303
+ /**
304
+ * What a customer is choosing about, in a sentence.
305
+ *
306
+ * @generated from field: string description = 4;
307
+ */
308
+ description: string;
309
+
310
+ /**
311
+ * A customer has to opt in before anything is sent to them under the
312
+ * proposed category. Left unset it is sent until a customer opts out.
313
+ *
314
+ * @generated from field: bool opt_in = 5;
315
+ */
316
+ optIn: boolean;
317
+ };
318
+
319
+ /**
320
+ * Describes the message apps.v1.FeatureNotificationCategory.
321
+ * Use `create(FeatureNotificationCategorySchema)` to create a new message.
322
+ */
323
+ export declare const FeatureNotificationCategorySchema: GenMessage<FeatureNotificationCategory>;
324
+
325
+ /**
326
+ * The notification category a feature keeps consent in.
327
+ *
328
+ * A feature that carries what a customer chose about a category to or from
329
+ * another system sends nothing itself. It reads and writes consent on one
330
+ * channel, and consent is what a category records where a customer opts in on
331
+ * that channel: nothing is sent there until they say yes. So the feature has
332
+ * to be given a category the project has and a customer opts in to on its
333
+ * channel, and nobody should have to type its key to do that. The feature says
334
+ * which of the app's settings holds the key and which channel's consent it
335
+ * keeps, and proposes the category it would keep it in. The setup offers the
336
+ * project's own categories a customer opts in to on that channel and the
337
+ * proposed one, makes the proposed one where the operator chooses it, and
338
+ * writes the chosen key to the setting. The app reads the setting.
339
+ *
340
+ * The platform holds the setting to that: while the feature is on at a running
341
+ * install it names a category the install's level is served and a customer
342
+ * opts in to on the channel, or, at a level served no category, the proposed
343
+ * key, which is made a category of that level together with its first, one a
344
+ * customer opts in to on every channel.
345
+ *
346
+ * @generated from message apps.v1.FeatureConsentCategory
347
+ */
348
+ export declare type FeatureConsentCategory = Message<"apps.v1.FeatureConsentCategory"> & {
349
+ /**
350
+ * REQUIRED. The string property of settings_schema that holds the key.
351
+ *
352
+ * @generated from field: string setting = 1;
353
+ */
354
+ setting: string;
355
+
356
+ /**
357
+ * REQUIRED. The key of the category the app proposes: what the category is
358
+ * called in the project's API. Letters, digits and underscores, starting
359
+ * with a letter. The proposed category is always one a customer opts in to,
360
+ * on every channel.
361
+ *
362
+ * @generated from field: string key = 2;
363
+ */
364
+ key: string;
365
+
366
+ /**
367
+ * REQUIRED. What the category is called to an operator and to a customer.
368
+ *
369
+ * @generated from field: string name = 3;
370
+ */
371
+ name: string;
372
+
373
+ /**
374
+ * What a customer is agreeing to, in a sentence.
375
+ *
376
+ * @generated from field: string description = 4;
377
+ */
378
+ description: string;
379
+
380
+ /**
381
+ * REQUIRED. The channel whose consent the feature keeps: email, push or
382
+ * in_app.
383
+ *
384
+ * @generated from field: string channel = 5;
385
+ */
386
+ channel: string;
387
+ };
388
+
389
+ /**
390
+ * Describes the message apps.v1.FeatureConsentCategory.
391
+ * Use `create(FeatureConsentCategorySchema)` to create a new message.
392
+ */
393
+ export declare const FeatureConsentCategorySchema: GenMessage<FeatureConsentCategory>;
394
+
245
395
  /**
246
396
  * @generated from message apps.v1.Metadata
247
397
  */
@@ -325,6 +475,17 @@ export declare type Credentials = Message<"apps.v1.Credentials"> & {
325
475
  * @generated from field: optional apps.v1.OAuthConfig oauth = 3;
326
476
  */
327
477
  oauth?: OAuthConfig | undefined;
478
+
479
+ /**
480
+ * What the operator is told before they connect their account, in the app's
481
+ * own words: anything connecting changes that they would not otherwise
482
+ * know. The setup shows it beside the step that connects, and an install the
483
+ * vendor started shows it before the install is confirmed, because that
484
+ * install goes on to connect by itself. Empty when there is nothing to say.
485
+ *
486
+ * @generated from field: string connect_notice = 4;
487
+ */
488
+ connectNotice: string;
328
489
  };
329
490
 
330
491
  /**
@@ -952,8 +1113,9 @@ export declare type Operation = Message<"apps.v1.Operation"> & {
952
1113
  /**
953
1114
  * REQUIRED. Kebab-case, unique within the manifest. Keys starting with
954
1115
  * `__` are platform-reserved (currently __uninstall, __validate_credentials).
955
- * On install the platform prefixes the stored key as `<appName>/<key>`
956
- * for namespace isolation across apps.
1116
+ * On install the platform stores it as `<appName>.<key>`, for namespace
1117
+ * isolation across apps; the key holds no ".", so the stored key is one
1118
+ * URL-safe segment.
957
1119
  *
958
1120
  * @generated from field: string key = 1;
959
1121
  */
@@ -977,16 +1139,35 @@ export declare type Operation = Message<"apps.v1.Operation"> & {
977
1139
  endpoint: string;
978
1140
 
979
1141
  /**
980
- * REQUIRED. Capability set the platform mints the scoped token with.
981
- * Each string is one of ManifestCapability, as its option spells it; a
982
- * per-model capability with no model (bare records:read) is rejected.
983
- * Placeholders `$<sourceType>` / `$<sinkContract>` inside model-scoped
984
- * capabilities are resolved to concrete model keys at ConfirmInstallApp.
1142
+ * Not read from a manifest an app serves. An operation declares its
1143
+ * `grants`, and a manifest that declares this is refused, naming them. The
1144
+ * field is kept so that a manifest stored before an operation was written by
1145
+ * its grants can still be decoded, where it is read as what each capability
1146
+ * was worth, until each stored manifest is rewritten.
985
1147
  *
986
1148
  * @generated from field: repeated string capabilities = 5;
987
1149
  */
988
1150
  capabilities: string[];
989
1151
 
1152
+ /**
1153
+ * REQUIRED. What the operation may do, as grants in the permission
1154
+ * catalogue's names. The token the operation is called with carries them,
1155
+ * and whoever installs the app is shown them and approves them.
1156
+ *
1157
+ * A manifest may declare the grants the platform lists for one, which is
1158
+ * fewer than a project's own operation may: an app's own settings, secrets
1159
+ * and status, files, the project's users, notifications, and records a
1160
+ * model at a time. A record permission names its model
1161
+ * (`records:read:<model>`) and one with no model is refused. A placeholder
1162
+ * (`$<sourceType>` or `$<sinkContract>`) in a model's place is resolved to
1163
+ * the model mapped there at ConfirmInstallApp. Changing a record takes its
1164
+ * write, and making one takes its create: an operation that upserts
1165
+ * declares both.
1166
+ *
1167
+ * @generated from field: repeated string grants = 13;
1168
+ */
1169
+ grants: string[];
1170
+
990
1171
  /**
991
1172
  * @generated from field: optional int32 timeout_ms = 6;
992
1173
  */
@@ -1013,12 +1194,15 @@ export declare type Operation = Message<"apps.v1.Operation"> & {
1013
1194
  supportsAsync?: boolean | undefined;
1014
1195
 
1015
1196
  /**
1016
- * When true, platform auto-enqueues this operation after a successful
1017
- * ConfirmInstallApp (and, for apps declaring __validate_credentials, after
1018
- * that gate passes). Multiple operations with run_after_install=true are
1019
- * dispatched in manifest declaration order. A failure here emits the
1020
- * app_event `post_install_op_failed` but does NOT roll back the install;
1021
- * the admin retries via the standard op-dispatch UI.
1197
+ * When true, the platform enqueues this operation each time the install
1198
+ * becomes ready to run: turned on, connected, and mapped for what the
1199
+ * operation runs on (with runs_on_mapped_sources, at least one source). The
1200
+ * moments are the install itself (once), a connection made or made again, a
1201
+ * turn on, and a mapping save that maps what it runs on. An app renewing its
1202
+ * own token is not a connection. Multiple operations with
1203
+ * run_after_install=true are dispatched in manifest declaration order. A
1204
+ * failure here emits the app_event `post_install_op_failed` but does NOT roll
1205
+ * back what triggered it; the admin retries via the standard op-dispatch UI.
1022
1206
  *
1023
1207
  * @generated from field: bool run_after_install = 11;
1024
1208
  */
@@ -1026,16 +1210,16 @@ export declare type Operation = Message<"apps.v1.Operation"> & {
1026
1210
 
1027
1211
  /**
1028
1212
  * When true, the operation works on whichever of its sources and sinks the
1029
- * install maps. A capability naming one left unmapped (an optional source
1213
+ * install maps. A grant naming one left unmapped (an optional source
1030
1214
  * the operator declined, or a source of a held install still being set up)
1031
1215
  * is left out of the resolved set, and the operation is kept.
1032
1216
  *
1033
1217
  * When false, the default, such an operation is dropped instead: it is not
1034
1218
  * created, and nothing dispatches it. That is the safe answer for an
1035
- * operation that would fail holding fewer capabilities than it declared.
1219
+ * operation that would fail holding fewer grants than it declared.
1036
1220
  *
1037
1221
  * An operation that sets this cannot find its models by their position in
1038
- * its capability list, because an entry may be missing. It finds each one by
1222
+ * its list of grants, because an entry may be missing. It finds each one by
1039
1223
  * its source or sink name in the install's mappings.
1040
1224
  *
1041
1225
  * @generated from field: bool runs_on_mapped_sources = 12;
@@ -1049,36 +1233,6 @@ export declare type Operation = Message<"apps.v1.Operation"> & {
1049
1233
  */
1050
1234
  export declare const OperationSchema: GenMessage<Operation>;
1051
1235
 
1052
- /**
1053
- * ManifestCapabilitySpec is how one ManifestCapability is written in a manifest.
1054
- *
1055
- * @generated from message apps.v1.ManifestCapabilitySpec
1056
- */
1057
- export declare type ManifestCapabilitySpec = Message<"apps.v1.ManifestCapabilitySpec"> & {
1058
- /**
1059
- * The capability as declared. When per_model is set it is the prefix a model
1060
- * follows, colon included: `records:read:` is declared as
1061
- * `records:read:<model>`, or with a `$<source>` or `$<sink>` placeholder the
1062
- * install resolves to the model mapped there.
1063
- *
1064
- * @generated from field: string declares = 1;
1065
- */
1066
- declares: string;
1067
-
1068
- /**
1069
- * Declared once per model. Without its model the capability is refused.
1070
- *
1071
- * @generated from field: bool per_model = 2;
1072
- */
1073
- perModel: boolean;
1074
- };
1075
-
1076
- /**
1077
- * Describes the message apps.v1.ManifestCapabilitySpec.
1078
- * Use `create(ManifestCapabilitySpecSchema)` to create a new message.
1079
- */
1080
- export declare const ManifestCapabilitySpecSchema: GenMessage<ManifestCapabilitySpec>;
1081
-
1082
1236
  /**
1083
1237
  * @generated from message apps.v1.Hook
1084
1238
  */
@@ -1111,7 +1265,7 @@ export declare type Hook = Message<"apps.v1.Hook"> & {
1111
1265
 
1112
1266
  /**
1113
1267
  * REQUIRED. Operation key from the same manifest's operations list.
1114
- * Resolved to the namespaced form (<appName>/<key>) at install.
1268
+ * Resolved to the stored form (<appName>.<key>) at install.
1115
1269
  *
1116
1270
  * @generated from field: string operation = 5;
1117
1271
  */
@@ -1227,14 +1381,9 @@ export declare type PlacementDeclaration = Message<"apps.v1.PlacementDeclaration
1227
1381
  hints?: JsonObject | undefined;
1228
1382
 
1229
1383
  /**
1230
- * What a TARGET_FULL_PAGE page asks to act with: API scopes such as
1231
- * "records:read:order". The console hands the page a short-lived token that
1232
- * acts as the operator looking at it, at the install's level, carrying the
1233
- * overlap of these scopes with what that operator holds there and never more.
1234
- * An operator standing beneath the install is given the reads only. The
1235
- * install preview lists them, so installing the app is agreeing to them.
1236
- * Refused on every other target: a record-bound placement is handed its
1237
- * record, not a credential.
1384
+ * Not read from a manifest an app serves: a placement declares grants, and
1385
+ * one that still declares scopes is refused by name. Kept so that a manifest
1386
+ * stored before still decodes, where each is read as what it was worth.
1238
1387
  *
1239
1388
  * @generated from field: repeated string scopes = 11;
1240
1389
  */
@@ -1246,12 +1395,28 @@ export declare type PlacementDeclaration = Message<"apps.v1.PlacementDeclaration
1246
1395
  * alert goes out or a preorder's deposit. The setup owns what the app is
1247
1396
  * given, so a feature's switch (Feature.setting), the setting that names the
1248
1397
  * external account, credentials and mappings are never among them. Changing
1249
- * or reading one needs apps:write, which the placement declares in scopes
1398
+ * or reading one needs apps:write, which the placement declares in grants
1250
1399
  * and the operator holds at the install's level, as in the setup.
1251
1400
  *
1252
1401
  * @generated from field: repeated string settings = 12;
1253
1402
  */
1254
1403
  settings: string[];
1404
+
1405
+ /**
1406
+ * What a TARGET_FULL_PAGE page asks to act with, as grants in the permission
1407
+ * catalogue's names, such as "records:read.all:order" for every order in
1408
+ * the project. Each is one a console user can hold, and none is a wildcard:
1409
+ * installing the app is agreeing to the list, and a wildcard would grow
1410
+ * after that. The console hands the page a short-lived token that acts as
1411
+ * the operator looking at it, at the install's level, carrying the overlap
1412
+ * of these grants with what that operator holds and never more. An operator
1413
+ * standing beneath the install is given the reads only. Refused on every
1414
+ * other target: a record-bound placement is handed its record, not a
1415
+ * credential.
1416
+ *
1417
+ * @generated from field: repeated string grants = 13;
1418
+ */
1419
+ grants: string[];
1255
1420
  };
1256
1421
 
1257
1422
  /**
@@ -1392,156 +1557,3 @@ export enum StorageOwner {
1392
1557
  */
1393
1558
  export declare const StorageOwnerSchema: GenEnum<StorageOwner>;
1394
1559
 
1395
- /**
1396
- * @generated from enum apps.v1.ManifestCapability
1397
- */
1398
- export enum ManifestCapability {
1399
- /**
1400
- * @generated from enum value: MANIFEST_CAPABILITY_UNSPECIFIED = 0;
1401
- */
1402
- UNSPECIFIED = 0,
1403
-
1404
- /**
1405
- * The install's own surface: its settings and mappings, its credential, and
1406
- * the status it reports.
1407
- *
1408
- * @generated from enum value: MANIFEST_CAPABILITY_CONFIG_READ = 1;
1409
- */
1410
- CONFIG_READ = 1,
1411
-
1412
- /**
1413
- * @generated from enum value: MANIFEST_CAPABILITY_SECRETS_READ_APP = 2;
1414
- */
1415
- SECRETS_READ_APP = 2,
1416
-
1417
- /**
1418
- * @generated from enum value: MANIFEST_CAPABILITY_SECRETS_PUT_APP = 3;
1419
- */
1420
- SECRETS_PUT_APP = 3,
1421
-
1422
- /**
1423
- * @generated from enum value: MANIFEST_CAPABILITY_SECRETS_LIST_APP = 4;
1424
- */
1425
- SECRETS_LIST_APP = 4,
1426
-
1427
- /**
1428
- * @generated from enum value: MANIFEST_CAPABILITY_SECRETS_DELETE_APP = 5;
1429
- */
1430
- SECRETS_DELETE_APP = 5,
1431
-
1432
- /**
1433
- * @generated from enum value: MANIFEST_CAPABILITY_STATUS_WRITE = 6;
1434
- */
1435
- STATUS_WRITE = 6,
1436
-
1437
- /**
1438
- * Files.
1439
- *
1440
- * @generated from enum value: MANIFEST_CAPABILITY_FILES_READ = 7;
1441
- */
1442
- FILES_READ = 7,
1443
-
1444
- /**
1445
- * @generated from enum value: MANIFEST_CAPABILITY_FILES_LIST = 8;
1446
- */
1447
- FILES_LIST = 8,
1448
-
1449
- /**
1450
- * @generated from enum value: MANIFEST_CAPABILITY_FILES_WRITE = 9;
1451
- */
1452
- FILES_WRITE = 9,
1453
-
1454
- /**
1455
- * Customers: making the customers an operation attributes records to,
1456
- * telling them something, and setting a named customer's consent.
1457
- *
1458
- * @generated from enum value: MANIFEST_CAPABILITY_CUSTOMERS_WRITE = 10;
1459
- */
1460
- CUSTOMERS_WRITE = 10,
1461
-
1462
- /**
1463
- * @generated from enum value: MANIFEST_CAPABILITY_NOTIFICATIONS_WRITE = 11;
1464
- */
1465
- NOTIFICATIONS_WRITE = 11,
1466
-
1467
- /**
1468
- * @generated from enum value: MANIFEST_CAPABILITY_NOTIFICATIONS_CONSENT = 12;
1469
- */
1470
- NOTIFICATIONS_CONSENT = 12,
1471
-
1472
- /**
1473
- * Reading customers at the install's level. customers:read:named is one
1474
- * customer the operation names, by id or by their exact email address, and
1475
- * never the list. customers:read is that and the list. An operation that
1476
- * declares the whole read holds the named one too.
1477
- *
1478
- * @generated from enum value: MANIFEST_CAPABILITY_CUSTOMERS_READ = 14;
1479
- */
1480
- CUSTOMERS_READ = 14,
1481
-
1482
- /**
1483
- * @generated from enum value: MANIFEST_CAPABILITY_CUSTOMERS_READ_NAMED = 15;
1484
- */
1485
- CUSTOMERS_READ_NAMED = 15,
1486
-
1487
- /**
1488
- * The link between a customer and who they are at the app's own system, and
1489
- * nothing else about them: the customer who holds an identity, and the
1490
- * identities a customer the operation names by id holds, both through the
1491
- * customer sign-in the install pairs with the app and no other. An operation
1492
- * that declares customers:read holds it too; customers:read:named does not
1493
- * reach it, nor it what that reaches.
1494
- *
1495
- * @generated from enum value: MANIFEST_CAPABILITY_CUSTOMERS_READ_IDENTITY = 16;
1496
- */
1497
- CUSTOMERS_READ_IDENTITY = 16,
1498
-
1499
- /**
1500
- * Reporting an ASYNC run's outcome.
1501
- *
1502
- * @generated from enum value: MANIFEST_CAPABILITY_OPERATIONS_COMPLETE = 13;
1503
- */
1504
- OPERATIONS_COMPLETE = 13,
1505
-
1506
- /**
1507
- * Records, per model. Delete and publish are their own capabilities: write
1508
- * implies neither. Attribute is naming the customer a record belongs to.
1509
- *
1510
- * @generated from enum value: MANIFEST_CAPABILITY_RECORDS_READ = 20;
1511
- */
1512
- RECORDS_READ = 20,
1513
-
1514
- /**
1515
- * @generated from enum value: MANIFEST_CAPABILITY_RECORDS_WRITE = 21;
1516
- */
1517
- RECORDS_WRITE = 21,
1518
-
1519
- /**
1520
- * @generated from enum value: MANIFEST_CAPABILITY_RECORDS_DELETE = 22;
1521
- */
1522
- RECORDS_DELETE = 22,
1523
-
1524
- /**
1525
- * @generated from enum value: MANIFEST_CAPABILITY_RECORDS_PUBLISH = 23;
1526
- */
1527
- RECORDS_PUBLISH = 23,
1528
-
1529
- /**
1530
- * @generated from enum value: MANIFEST_CAPABILITY_RECORDS_ATTRIBUTE = 24;
1531
- */
1532
- RECORDS_ATTRIBUTE = 24,
1533
- }
1534
-
1535
- /**
1536
- * Describes the enum apps.v1.ManifestCapability.
1537
- */
1538
- export declare const ManifestCapabilitySchema: GenEnum<ManifestCapability>;
1539
-
1540
- /**
1541
- * 60003 is in the organisation-internal extension range, beside the intent
1542
- * option's 60001 and the config destination's 60002.
1543
- *
1544
- * @generated from extension: apps.v1.ManifestCapabilitySpec manifest_capability = 60003;
1545
- */
1546
- export declare const manifest_capability: GenExtension<EnumValueOptions, ManifestCapabilitySpec>;
1547
-
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Every call an app client makes fails with the package's one error,
5
5
  * `FoirRequestError`, carrying the platform's own answer. Nothing is checked
6
- * before the call: the token's capabilities are the platform's to hold it to,
6
+ * before the call: the token's grants are the platform's to hold it to,
7
7
  * and its refusal names the reason. The readers here pick out the refusals an
8
8
  * app acts on rather than reports, as data and never by the wording of a
9
9
  * message.
@@ -56,7 +56,7 @@ export declare function appCustomerEmailUnavailableOf(error: unknown): {
56
56
  } | null;
57
57
  /**
58
58
  * Whether a read failed because the token is not served the field it asked
59
- * for: the field is not on the schema this token's capabilities reach. That is
59
+ * for: the field is not on the schema this token's grants reach. That is
60
60
  * the platform's refusal of a read, as data: the selection it stripped.
61
61
  *
62
62
  * `field` narrows it to one root field. The platform names a stripped
@@ -16,12 +16,12 @@
16
16
  * readCredentialProbe and of the credential probe.
17
17
  * redeemExchangeTicket the token an OAuth callback writes a credential with.
18
18
  * validateAppManifest ask the platform whether it would accept a manifest.
19
- * APP_CAPABILITIES… the capabilities and hook events the contract lists.
19
+ * APP_GRANTS… the grants a manifest may declare, and the hook events.
20
20
  *
21
21
  * The manifest's own messages are on `@foir/sdk/app/contract`.
22
22
  */
23
23
  export { createAppClient } from './client';
24
- export type { AppBinding, AppClient, AppClientConfig, AppConsentChange, AppCustomer, AppCustomerEraseResult, AppCustomerList, AppCustomerSaveResult, AppFieldMapping, AppInstallConfig, AppNotification, AppOperationStart, AppRecord, AppRecordList, AppStartedOperation, AppStatusReport, AppSyncDirection, AppUpsertResult, AppWhoami, } from './client';
24
+ export type { AppBinding, AppClient, AppClientConfig, AppConsentChange, AppConsentSubject, AppCustomer, AppCustomerEraseResult, AppCustomerList, AppCustomerSaveResult, AppFieldMapping, AppInstallConfig, AppNotification, AppOperationStart, AppOrganizationProvision, AppRecord, AppRecordList, AppStartedOperation, AppStatusReport, AppSyncDirection, AppUpsertResult, AppWhoami, } from './client';
25
25
  export { appCustomerEmailUnavailableOf, appCustomerUnlinkedOf, appLookupConflictOf, isAppFieldWithheld } from './errors';
26
26
  export type { AppCustomerEmailUnavailableReason, AppLookupConflict } from './errors';
27
27
  export { appModelFieldName, appModelTypeName, appSelectorEnumValue } from './naming';
@@ -32,8 +32,8 @@ export { redeemExchangeTicket } from './ticket';
32
32
  export type { RedeemedExchangeTicket } from './ticket';
33
33
  export { validateAppManifest, MAX_APP_MANIFEST_BYTES } from './manifest';
34
34
  export type { AppManifestIssue, AppManifestValidation, ValidateAppManifestOptions } from './manifest';
35
- export { APP_CAPABILITIES, APP_HOOK_EVENTS, APP_RECORD_CAPABILITY_PREFIXES } from './vocabulary.generated';
36
- export type { AppCapability, AppHookEvent, AppRecordCapabilityPrefix } from './vocabulary.generated';
35
+ export { APP_GRANTS, APP_HOOK_EVENTS, APP_RECORD_GRANT_PREFIXES } from './vocabulary.generated';
36
+ export type { AppGrant, AppHookEvent, AppRecordGrantPrefix } from './vocabulary.generated';
37
37
  export type { FoirDispatchCredential } from '../data/transport';
38
38
  export { FoirRequestError } from '../transport/foir-http';
39
39
  export type { FoirErrorCode, FoirErrorExtensions, FoirGraphQLErrorItem, FoirPrunedSelection } from '../transport/foir-http';
@@ -2,7 +2,7 @@
2
2
  * Ask the platform whether it would accept an app's manifest.
3
3
  *
4
4
  * A manifest is held to rules only the platform knows in full: which
5
- * capabilities exist, which events a hook may name, how a feature's storage
5
+ * grants an operation may declare, which events a hook may name, how a feature's storage
6
6
  * may be declared, what an install would refuse. Copying those rules into an
7
7
  * app's build means the copy and the platform disagree the first time either
8
8
  * changes. So the build asks instead. `validateAppManifest` sends the manifest
@@ -3,18 +3,21 @@
3
3
  * manifest's hook may subscribe to (an event of the project, that something
4
4
  * emits) is the platform's to say: `validateAppManifest` answers it.
5
5
  */
6
- export declare const APP_HOOK_EVENTS: readonly ["RECORD_CREATED", "RECORD_UPDATED", "RECORD_DELETED", "RECORD_PUBLISHED", "RECORD_UNPUBLISHED", "CUSTOMER_CREATED", "CUSTOMER_UPDATED", "CUSTOMER_DELETED", "CUSTOMER_MERGED", "SESSION_REVOKED", "OPERATION_COMPLETED", "OPERATION_FAILED", "OPERATION_CANCELLED", "OPERATION_TIMED_OUT", "ADMIN_MEMBERSHIP_GRANTED", "ADMIN_MEMBERSHIP_REVOKED", "ADMIN_ROLE_CHANGED", "TENANT_PLAN_CHANGED", "TENANT_SUBSCRIPTION_STATUS_CHANGED", "PROJECT_CREATED", "PROJECT_ARCHIVED", "INVITATION_ACCEPTED", "IMPORT_COMPLETED", "MIGRATION_APPLIED", "BULK_UPDATE_COMPLETED", "BULK_PUBLISH_COMPLETED", "CUSTOMER_PREFERENCE_CHANGED", "ORGANIZATION_CREATED", "ORGANIZATION_UPDATED", "ORGANIZATION_MOVED", "ORGANIZATION_SUSPENDED", "ORGANIZATION_RESUMED", "ORGANIZATION_DELETION_SCHEDULED", "ORGANIZATION_DELETION_CANCELLED", "ORGANIZATION_DELETED", "ORGANIZATION_MEMBER_ADDED", "ORGANIZATION_MEMBER_REMOVED", "ORGANIZATION_MEMBER_ROLE_CHANGED"];
6
+ export declare const APP_HOOK_EVENTS: readonly ["RECORD_CREATED", "RECORD_UPDATED", "RECORD_DELETED", "RECORD_PUBLISHED", "RECORD_UNPUBLISHED", "CUSTOMER_CREATED", "CUSTOMER_UPDATED", "CUSTOMER_DELETED", "CUSTOMER_MERGED", "SESSION_REVOKED", "OPERATION_COMPLETED", "OPERATION_FAILED", "OPERATION_CANCELLED", "OPERATION_TIMED_OUT", "ADMIN_MEMBERSHIP_GRANTED", "ADMIN_MEMBERSHIP_REVOKED", "ADMIN_ROLE_CHANGED", "TENANT_PLAN_CHANGED", "TENANT_SUBSCRIPTION_STATUS_CHANGED", "PROJECT_CREATED", "PROJECT_ARCHIVED", "INVITATION_ACCEPTED", "IMPORT_COMPLETED", "MIGRATION_APPLIED", "BULK_UPDATE_COMPLETED", "BULK_PUBLISH_COMPLETED", "CUSTOMER_PREFERENCE_CHANGED", "ORGANIZATION_CREATED", "ORGANIZATION_UPDATED", "ORGANIZATION_MOVED", "ORGANIZATION_SUSPENDED", "ORGANIZATION_RESUMED", "ORGANIZATION_DELETION_SCHEDULED", "ORGANIZATION_DELETION_CANCELLED", "ORGANIZATION_DELETED", "ORGANIZATION_MEMBER_ADDED", "ORGANIZATION_MEMBER_REMOVED", "ORGANIZATION_MEMBER_ROLE_CHANGED", "PROJECT_REACTIVATED"];
7
7
  /** An event a hook can name. */
8
8
  export type AppHookEvent = (typeof APP_HOOK_EVENTS)[number];
9
- /** The capabilities an operation declares as written. */
10
- export declare const APP_CAPABILITIES: readonly ["config:read", "secrets:read.app", "secrets:put.app", "secrets:list.app", "secrets:delete.app", "status:write", "files:read", "files:list", "files:write", "customers:write", "notifications:write", "notifications:consent", "customers:read", "customers:read:named", "customers:read:identity", "operations:complete"];
11
- /** A capability an operation declares as written. */
12
- export type AppCapability = (typeof APP_CAPABILITIES)[number];
13
9
  /**
14
- * The capabilities an operation declares once per model. Each is a prefix: a
15
- * model key follows it, or `$<name>` for the model an install maps one of the
10
+ * The grants an operation declares as written, in the permission catalogue's
11
+ * names.
12
+ */
13
+ export declare const APP_GRANTS: readonly ["appconfig:read", "appsecrets:delete", "appsecrets:list", "appsecrets:put", "appsecrets:read", "files:delete", "files:delete.all", "files:read", "files:read.all", "files:write", "files:write.all", "identities:delete", "identities:read", "notifications:consent", "notifications:read", "notifications:write.named", "operations:complete", "organizations:create", "organizations:delete", "status:write", "users:create", "users:read.all", "users:read.named"];
14
+ /** A grant an operation declares as written. */
15
+ export type AppGrant = (typeof APP_GRANTS)[number];
16
+ /**
17
+ * The grants an operation declares once per model. Each is a prefix: a model
18
+ * key follows it, or `$<name>` for the model an install maps one of the
16
19
  * app's sources or sinks onto.
17
20
  */
18
- export declare const APP_RECORD_CAPABILITY_PREFIXES: readonly ["records:read:", "records:write:", "records:delete:", "records:publish:", "records:attribute:"];
19
- /** A per-model capability's prefix. */
20
- export type AppRecordCapabilityPrefix = (typeof APP_RECORD_CAPABILITY_PREFIXES)[number];
21
+ export declare const APP_RECORD_GRANT_PREFIXES: readonly ["records:attribute:", "records:create:", "records:delete.all:", "records:delete:", "records:publish.all:", "records:publish:", "records:read.all:", "records:read:", "records:write.all:", "records:write:"];
22
+ /** A per-model grant's prefix. */
23
+ export type AppRecordGrantPrefix = (typeof APP_RECORD_GRANT_PREFIXES)[number];