@mintplayer/ng-spark 22.26.0 → 22.28.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.
Files changed (41) hide show
  1. package/README.md +6 -4
  2. package/fesm2022/mintplayer-ng-spark-grid.mjs +73 -50
  3. package/fesm2022/mintplayer-ng-spark-grid.mjs.map +1 -1
  4. package/fesm2022/mintplayer-ng-spark-history.mjs +1 -1
  5. package/fesm2022/mintplayer-ng-spark-history.mjs.map +1 -1
  6. package/fesm2022/mintplayer-ng-spark-models.mjs +19 -10
  7. package/fesm2022/mintplayer-ng-spark-models.mjs.map +1 -1
  8. package/fesm2022/mintplayer-ng-spark-moderation.mjs +1 -1
  9. package/fesm2022/mintplayer-ng-spark-moderation.mjs.map +1 -1
  10. package/fesm2022/mintplayer-ng-spark-pipes.mjs +5 -2
  11. package/fesm2022/mintplayer-ng-spark-pipes.mjs.map +1 -1
  12. package/fesm2022/mintplayer-ng-spark-po-create.mjs +16 -7
  13. package/fesm2022/mintplayer-ng-spark-po-create.mjs.map +1 -1
  14. package/fesm2022/mintplayer-ng-spark-po-detail.mjs +30 -14
  15. package/fesm2022/mintplayer-ng-spark-po-detail.mjs.map +1 -1
  16. package/fesm2022/mintplayer-ng-spark-po-edit.mjs +45 -15
  17. package/fesm2022/mintplayer-ng-spark-po-edit.mjs.map +1 -1
  18. package/fesm2022/mintplayer-ng-spark-po-form.mjs +4 -4
  19. package/fesm2022/mintplayer-ng-spark-po-form.mjs.map +1 -1
  20. package/fesm2022/mintplayer-ng-spark-query-list.mjs +18 -2
  21. package/fesm2022/mintplayer-ng-spark-query-list.mjs.map +1 -1
  22. package/fesm2022/mintplayer-ng-spark-renderers.mjs +2 -1
  23. package/fesm2022/mintplayer-ng-spark-renderers.mjs.map +1 -1
  24. package/fesm2022/mintplayer-ng-spark-retry-action-modal.mjs +0 -1
  25. package/fesm2022/mintplayer-ng-spark-retry-action-modal.mjs.map +1 -1
  26. package/fesm2022/mintplayer-ng-spark-services.mjs +12 -9
  27. package/fesm2022/mintplayer-ng-spark-services.mjs.map +1 -1
  28. package/fesm2022/mintplayer-ng-spark-soft-delete.mjs +4 -3
  29. package/fesm2022/mintplayer-ng-spark-soft-delete.mjs.map +1 -1
  30. package/package.json +3 -3
  31. package/types/mintplayer-ng-spark-grid.d.ts +50 -46
  32. package/types/mintplayer-ng-spark-models.d.ts +75 -40
  33. package/types/mintplayer-ng-spark-moderation.d.ts +8 -4
  34. package/types/mintplayer-ng-spark-pipes.d.ts +3 -0
  35. package/types/mintplayer-ng-spark-po-create.d.ts +4 -0
  36. package/types/mintplayer-ng-spark-po-detail.d.ts +12 -2
  37. package/types/mintplayer-ng-spark-po-edit.d.ts +16 -0
  38. package/types/mintplayer-ng-spark-po-form.d.ts +1 -0
  39. package/types/mintplayer-ng-spark-query-list.d.ts +11 -1
  40. package/types/mintplayer-ng-spark-services.d.ts +38 -9
  41. package/types/mintplayer-ng-spark-soft-delete.d.ts +1 -1
@@ -62,11 +62,22 @@ export interface NewObjectOptions {
62
62
  }
63
63
  /** Where a bulk delete was started from; see {@link SparkService.deleteMany}. */
64
64
  export interface DeleteManyOptions {
65
- /** The query the rows were selected in, for the server's `OnDisableActionsAsync`. */
66
- queryId?: string;
65
+ /**
66
+ * The query the rows were selected in. Required (#467, D12): the server fetches the rows through it
67
+ * and applies its `OnDisableActionsAsync` decision; without it the call is a 400.
68
+ */
69
+ queryId: string;
67
70
  /** The sub-query's container, when deleting from a sub-query. */
68
71
  parentId?: string;
69
72
  parentType?: string;
73
+ /** One reason for the whole batch, recorded on every soft-deleted row (#467, D20). */
74
+ reason?: string;
75
+ }
76
+ /** A row and the version of it the caller saw (#467, D14): what a bulk delete names. */
77
+ export interface SparkRowVersion {
78
+ id: string;
79
+ /** The row's `etag` from the query result. */
80
+ etag: string;
70
81
  }
71
82
  /** Context for {@link SparkService.deleteRow}. Every field is required — see `DeleteRow.cs`. */
72
83
  export interface DeleteRowOptions {
@@ -92,7 +103,11 @@ export declare class SparkService {
92
103
  private static readonly MAX_RETRY_DEPTH;
93
104
  private readonly dispatcher;
94
105
  getEntityTypes(): Promise<EntityType[]>;
95
- getEntityType(id: string): Promise<EntityType>;
106
+ /**
107
+ * One entity type, shaped by the caller's attribute rights. `purpose` narrows it for one form (#264, G1/G2):
108
+ * `'new'` leaves out what the caller may not create and does not apply edit-only denies.
109
+ */
110
+ getEntityType(id: string, purpose?: 'new' | 'edit' | 'read'): Promise<EntityType>;
96
111
  getEntityTypeByClrType(clrType: string): Promise<EntityType | undefined>;
97
112
  getPermissions(entityTypeId: string): Promise<EntityPermissions>;
98
113
  getQueries(): Promise<SparkQuery[]>;
@@ -155,12 +170,20 @@ export declare class SparkService {
155
170
  * `parent` is the sub-query the New was started from — the same `parentId`/`parentType`/`queryId`
156
171
  * `newObject` was given. The server resolves and authorizes it again and hands it to the save hooks
157
172
  * as `PersistentObject.Parent`.
173
+ *
174
+ * Resolves to `null` when a server interceptor cancelled the create (#482: the user answered a prompt with
175
+ * Cancel) — the server answers 204 and nothing was created.
158
176
  */
159
177
  create(type: string, data: Partial<PersistentObject>, parent?: {
160
178
  parentId: string;
161
179
  parentType: string;
162
180
  queryId: string;
163
- }): Promise<PersistentObject>;
181
+ }): Promise<PersistentObject | null>;
182
+ /**
183
+ * Saves an edit. `data.etag` — the etag the object was loaded with — is required (#467, D16): it is
184
+ * the version being edited. A 409 means the object changed since (`reason: 'changed'`) or was
185
+ * deleted since (`reason: 'deleted'`).
186
+ */
164
187
  update(type: string, id: string, data: Partial<PersistentObject>): Promise<PersistentObject>;
165
188
  /**
166
189
  * Asks the server to reshape an in-progress object after `triggeredBy`'s value changed.
@@ -199,14 +222,20 @@ export declare class SparkService {
199
222
  * of the route variables.
200
223
  */
201
224
  deleteRow(type: string, options: DeleteRowOptions): Promise<void>;
202
- delete(type: string, id: string): Promise<void>;
225
+ /**
226
+ * Deletes one object. `etag` is the version being deleted — the loaded object's `etag` — and is
227
+ * required (#467, D14): an object changed since is a 409.
228
+ */
229
+ delete(type: string, id: string, etag: string): Promise<void>;
203
230
  /**
204
231
  * Deletes several rows of one type in one request — the default Delete action on a selection
205
- * (`POST /spark/po/delete-many`, #460 D18). All or nothing: a 404 means some row is missing or not
206
- * yours to delete, a 403 that the server's `OnDisableActionsAsync` withholds Delete on the query or
207
- * on one of the rows, a 400 that the selection breaks the rule or the 200-row cap.
232
+ * (`POST /spark/po/delete-many`, #460 D18). Each row carries the `etag` its query result row had
233
+ * (#467, D14). All or nothing: a 404 means some row is missing or not yours to delete, a 403 that
234
+ * the server's `OnDisableActionsAsync` withholds Delete on the query or on one of the rows, a 409
235
+ * that rows changed since the list loaded (the body's `message` names them), a 400 that the
236
+ * selection breaks the rule or the 200-row cap.
208
237
  */
209
- deleteMany(type: string, ids: string[], options?: DeleteManyOptions): Promise<void>;
238
+ deleteMany(type: string, items: SparkRowVersion[], options: DeleteManyOptions): Promise<void>;
210
239
  getCustomActions(objectTypeId: string): Promise<CustomActionDefinition[]>;
211
240
  /**
212
241
  * @param parent The object of THIS type the action is operating on — the detail-page invocation.
@@ -17,7 +17,7 @@ export declare class SparkSoftDeleteService {
17
17
  * `POST /spark/po/purge` → 204. Requires `Purge/T` and a deleted row. Removes the document and
18
18
  * every revision of it; it cannot be undone.
19
19
  */
20
- purge(type: string, id: string): Promise<void>;
20
+ purge(type: string, id: string, etag: string): Promise<void>;
21
21
  static ɵfac: i0.ɵɵFactoryDeclaration<SparkSoftDeleteService, never>;
22
22
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
23
23
  }