@stacksjs/defaults 0.74.1 → 0.74.3
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/app/Actions/Dashboard/Marketing/AbandonedCartCampaignAction.ts +51 -0
- package/app/Actions/Dashboard/Marketing/AbandonedCartIndexAction.ts +85 -0
- package/app/Actions/Dashboard/Marketing/abandoned-cart-records.test.ts +316 -0
- package/app/Actions/Dashboard/Marketing/abandoned-cart-records.ts +429 -0
- package/app/Models/AnalyticsEvent.ts +5 -0
- package/app/Models/Content/Menu.ts +5 -1
- package/app/Models/Content/MenuItem.ts +6 -1
- package/app/Models/Content/Page.ts +5 -1
- package/app/Models/Content/Post.ts +5 -1
- package/app/Models/Content/Redirect.ts +5 -1
- package/app/Models/EmailIdempotency.ts +5 -0
- package/app/Models/EmailList.ts +6 -0
- package/app/Models/EmailSuppression.ts +5 -0
- package/app/Models/EmailWebhookEvent.ts +5 -0
- package/app/Models/Forms/Form.ts +5 -1
- package/app/Models/Forms/FormField.ts +6 -1
- package/app/Models/MailPreference.ts +5 -0
- package/app/Models/Request.ts +5 -0
- package/app/Models/SiteDomain.ts +5 -1
- package/app/Models/Tag.ts +6 -0
- package/app/Models/Team.ts +6 -1
- package/app/Models/User.ts +6 -1
- package/app/Models/commerce/Auction.ts +6 -0
- package/app/Models/commerce/AuctionItem.ts +6 -0
- package/app/Models/commerce/Cart.ts +6 -1
- package/app/Models/commerce/CartItem.ts +6 -1
- package/app/Models/commerce/Category.ts +6 -0
- package/app/Models/commerce/Coupon.ts +6 -0
- package/app/Models/commerce/DeliveryRoute.ts +6 -1
- package/app/Models/commerce/DeliveryStop.ts +6 -1
- package/app/Models/commerce/GiftCard.ts +6 -1
- package/app/Models/commerce/LicenseKey.ts +6 -1
- package/app/Models/commerce/LoyaltyReward.ts +6 -0
- package/app/Models/commerce/Manufacturer.ts +6 -0
- package/app/Models/commerce/Order.ts +6 -1
- package/app/Models/commerce/Payment.ts +6 -1
- package/app/Models/commerce/PrintDevice.ts +6 -0
- package/app/Models/commerce/Product.ts +6 -0
- package/app/Models/commerce/ProductUnit.ts +6 -0
- package/app/Models/commerce/ProductVariant.ts +6 -0
- package/app/Models/commerce/Review.ts +6 -1
- package/app/Models/commerce/ShippingMethod.ts +6 -0
- package/app/Models/commerce/ShippingRate.ts +6 -0
- package/app/Models/commerce/ShippingZone.ts +6 -0
- package/app/Models/commerce/TaxRate.ts +6 -0
- package/app/Models/commerce/Transaction.ts +6 -1
- package/app/Models/commerce/WaitlistProduct.ts +6 -1
- package/app/Models/commerce/WaitlistRestaurant.ts +6 -1
- package/app/Models/realtime/Websocket.ts +5 -0
- package/ide/vscode/package.json +1 -1
- package/package.json +2 -2
- package/project/storage/framework/tsconfig.app.json +4 -1
- package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +240 -0
- package/resources/components/Dashboard/Marketing/AbandonedCartsTable.stx +96 -0
- package/resources/components/Dashboard/Marketing/RecoveryCampaignDialog.stx +145 -0
- package/resources/functions/dashboard/sidebar.ts +1 -0
- package/resources/views/cms/blocks/form.stx +92 -1
- package/routes/dashboard-api.ts +5 -0
- package/routes/forms.ts +46 -0
- package/views/dashboard/marketing/abandoned-carts/index.stx +10 -0
package/app/Models/Team.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineModel } from '@stacksjs/orm'
|
|
1
|
+
import { defineModel, teamMembershipOwnership } from '@stacksjs/orm'
|
|
2
2
|
import { schema } from '@stacksjs/validation'
|
|
3
3
|
|
|
4
4
|
export default defineModel({
|
|
@@ -7,6 +7,11 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// The owner column is the primary key: a caller may write the team they are
|
|
11
|
+
// actually a member of, resolved by the same auth path every other
|
|
12
|
+
// team-scoped model uses (stacksjs/stacks#2375).
|
|
13
|
+
ownership: teamMembershipOwnership(),
|
|
14
|
+
|
|
10
15
|
traits: {
|
|
11
16
|
useUuid: true,
|
|
12
17
|
useTimestamps: true,
|
package/app/Models/User.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Attributes } from '@stacksjs/types'
|
|
2
|
-
import { defineModel } from '@stacksjs/orm'
|
|
2
|
+
import { defineModel, selfOwnership } from '@stacksjs/orm'
|
|
3
3
|
import { makeHash } from '@stacksjs/security'
|
|
4
4
|
// soon, these will be auto-imported
|
|
5
5
|
import { schema } from '@stacksjs/validation'
|
|
@@ -19,6 +19,11 @@ export default defineModel({
|
|
|
19
19
|
},
|
|
20
20
|
],
|
|
21
21
|
|
|
22
|
+
// A caller may write their own row and no other (stacksjs/stacks#2375). The
|
|
23
|
+
// owner column IS the primary key here, so without this `User` is the worst
|
|
24
|
+
// case the issue describes: an authenticated caller able to PATCH any user.
|
|
25
|
+
ownership: selfOwnership(),
|
|
26
|
+
|
|
22
27
|
traits: {
|
|
23
28
|
useAuth: {
|
|
24
29
|
usePasskey: true,
|
|
@@ -17,6 +17,12 @@ export default defineModel({
|
|
|
17
17
|
primaryKey: 'id',
|
|
18
18
|
autoIncrement: true,
|
|
19
19
|
|
|
20
|
+
// A reference table: no row here has a per-caller owner, so there is nothing
|
|
21
|
+
// to scope by and writes are an administrative concern gated by `middleware`.
|
|
22
|
+
// Declared rather than left silent so `security.api.rowScoping: 'deny'` can
|
|
23
|
+
// tell "considered" from "nobody thought about it" (stacksjs/stacks#2375).
|
|
24
|
+
ownership: false,
|
|
25
|
+
|
|
20
26
|
traits: {
|
|
21
27
|
useUuid: true,
|
|
22
28
|
useTimestamps: true,
|
|
@@ -13,6 +13,12 @@ export default defineModel({
|
|
|
13
13
|
primaryKey: 'id',
|
|
14
14
|
autoIncrement: true,
|
|
15
15
|
|
|
16
|
+
// A reference table: no row here has a per-caller owner, so there is nothing
|
|
17
|
+
// to scope by and writes are an administrative concern gated by `middleware`.
|
|
18
|
+
// Declared rather than left silent so `security.api.rowScoping: 'deny'` can
|
|
19
|
+
// tell "considered" from "nobody thought about it" (stacksjs/stacks#2375).
|
|
20
|
+
ownership: false,
|
|
21
|
+
|
|
16
22
|
traits: {
|
|
17
23
|
useUuid: true,
|
|
18
24
|
useTimestamps: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineModel } from '@stacksjs/orm'
|
|
1
|
+
import { customerOwnership, defineModel } from '@stacksjs/orm'
|
|
2
2
|
import { schema } from '@stacksjs/validation'
|
|
3
3
|
|
|
4
4
|
export default defineModel({
|
|
@@ -7,6 +7,11 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// Rows belong to the caller's customer record, one hop from the user
|
|
11
|
+
// (stacksjs/stacks#2375). Without this the generated writes are reachable by
|
|
12
|
+
// any authenticated caller for any row.
|
|
13
|
+
ownership: customerOwnership(),
|
|
14
|
+
|
|
10
15
|
traits: {
|
|
11
16
|
useUuid: true,
|
|
12
17
|
useTimestamps: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineModel } from '@stacksjs/orm'
|
|
1
|
+
import { defineModel, parentOwnership } from '@stacksjs/orm'
|
|
2
2
|
import { schema } from '@stacksjs/validation'
|
|
3
3
|
|
|
4
4
|
export default defineModel({
|
|
@@ -7,6 +7,11 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// No owner of its own: these rows are owned by whoever owns the cart's customer
|
|
11
|
+
// (stacksjs/stacks#2375). Resolved through the parent so it follows any change
|
|
12
|
+
// to how Cart decides ownership.
|
|
13
|
+
ownership: parentOwnership('Cart', 'cart_id'),
|
|
14
|
+
|
|
10
15
|
traits: {
|
|
11
16
|
useUuid: true,
|
|
12
17
|
useTimestamps: true,
|
|
@@ -8,6 +8,12 @@ export default defineModel({
|
|
|
8
8
|
primaryKey: 'id',
|
|
9
9
|
autoIncrement: true,
|
|
10
10
|
|
|
11
|
+
// A reference table: no row here has a per-caller owner, so there is nothing
|
|
12
|
+
// to scope by and writes are an administrative concern gated by `middleware`.
|
|
13
|
+
// Declared rather than left silent so `security.api.rowScoping: 'deny'` can
|
|
14
|
+
// tell "considered" from "nobody thought about it" (stacksjs/stacks#2375).
|
|
15
|
+
ownership: false,
|
|
16
|
+
|
|
11
17
|
traits: {
|
|
12
18
|
useUuid: true,
|
|
13
19
|
useTimestamps: true,
|
|
@@ -7,6 +7,12 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// A reference table: no row here has a per-caller owner, so there is nothing
|
|
11
|
+
// to scope by and writes are an administrative concern gated by `middleware`.
|
|
12
|
+
// Declared rather than left silent so `security.api.rowScoping: 'deny'` can
|
|
13
|
+
// tell "considered" from "nobody thought about it" (stacksjs/stacks#2375).
|
|
14
|
+
ownership: false,
|
|
15
|
+
|
|
10
16
|
traits: {
|
|
11
17
|
useUuid: true,
|
|
12
18
|
useTimestamps: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineModel } from '@stacksjs/orm'
|
|
1
|
+
import { defineModel, parentOwnership } from '@stacksjs/orm'
|
|
2
2
|
import { schema } from '@stacksjs/validation'
|
|
3
3
|
|
|
4
4
|
export default defineModel({
|
|
@@ -7,6 +7,11 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// No owner of its own: these rows are owned by whoever owns the courier, who is a user
|
|
11
|
+
// (stacksjs/stacks#2375). Resolved through the parent so it follows any change
|
|
12
|
+
// to how Courier decides ownership.
|
|
13
|
+
ownership: parentOwnership('Courier', 'courier_id'),
|
|
14
|
+
|
|
10
15
|
traits: {
|
|
11
16
|
useUuid: true,
|
|
12
17
|
useTimestamps: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineModel } from '@stacksjs/orm'
|
|
1
|
+
import { defineModel, parentOwnership } from '@stacksjs/orm'
|
|
2
2
|
import { schema } from '@stacksjs/validation'
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -18,6 +18,11 @@ export default defineModel({
|
|
|
18
18
|
primaryKey: 'id',
|
|
19
19
|
autoIncrement: true,
|
|
20
20
|
|
|
21
|
+
// No owner of its own: these rows are owned by whoever owns the order's customer
|
|
22
|
+
// (stacksjs/stacks#2375). Resolved through the parent so it follows any change
|
|
23
|
+
// to how Order decides ownership.
|
|
24
|
+
ownership: parentOwnership('Order', 'order_id'),
|
|
25
|
+
|
|
21
26
|
traits: {
|
|
22
27
|
useUuid: true,
|
|
23
28
|
useTimestamps: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineModel } from '@stacksjs/orm'
|
|
1
|
+
import { customerOwnership, defineModel } from '@stacksjs/orm'
|
|
2
2
|
import { schema } from '@stacksjs/validation'
|
|
3
3
|
|
|
4
4
|
export default defineModel({
|
|
@@ -7,6 +7,11 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// Rows belong to the caller's customer record, one hop from the user
|
|
11
|
+
// (stacksjs/stacks#2375). Without this the generated writes are reachable by
|
|
12
|
+
// any authenticated caller for any row.
|
|
13
|
+
ownership: customerOwnership(),
|
|
14
|
+
|
|
10
15
|
traits: {
|
|
11
16
|
useUuid: true,
|
|
12
17
|
useTimestamps: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineModel } from '@stacksjs/orm'
|
|
1
|
+
import { customerOwnership, defineModel } from '@stacksjs/orm'
|
|
2
2
|
import { schema } from '@stacksjs/validation'
|
|
3
3
|
|
|
4
4
|
export default defineModel({
|
|
@@ -7,6 +7,11 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// Rows belong to the caller's customer record, one hop from the user
|
|
11
|
+
// (stacksjs/stacks#2375). Without this the generated writes are reachable by
|
|
12
|
+
// any authenticated caller for any row.
|
|
13
|
+
ownership: customerOwnership(),
|
|
14
|
+
|
|
10
15
|
traits: {
|
|
11
16
|
useUuid: true,
|
|
12
17
|
useTimestamps: true,
|
|
@@ -7,6 +7,12 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// A reference table: no row here has a per-caller owner, so there is nothing
|
|
11
|
+
// to scope by and writes are an administrative concern gated by `middleware`.
|
|
12
|
+
// Declared rather than left silent so `security.api.rowScoping: 'deny'` can
|
|
13
|
+
// tell "considered" from "nobody thought about it" (stacksjs/stacks#2375).
|
|
14
|
+
ownership: false,
|
|
15
|
+
|
|
10
16
|
traits: {
|
|
11
17
|
useUuid: true,
|
|
12
18
|
useTimestamps: true,
|
|
@@ -7,6 +7,12 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// A reference table: no row here has a per-caller owner, so there is nothing
|
|
11
|
+
// to scope by and writes are an administrative concern gated by `middleware`.
|
|
12
|
+
// Declared rather than left silent so `security.api.rowScoping: 'deny'` can
|
|
13
|
+
// tell "considered" from "nobody thought about it" (stacksjs/stacks#2375).
|
|
14
|
+
ownership: false,
|
|
15
|
+
|
|
10
16
|
traits: {
|
|
11
17
|
useUuid: true,
|
|
12
18
|
useTimestamps: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineModel } from '@stacksjs/orm'
|
|
1
|
+
import { customerOwnership, defineModel } from '@stacksjs/orm'
|
|
2
2
|
import { schema } from '@stacksjs/validation'
|
|
3
3
|
|
|
4
4
|
export default defineModel({
|
|
@@ -7,6 +7,11 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// Rows belong to the caller's customer record, one hop from the user
|
|
11
|
+
// (stacksjs/stacks#2375). Without this the generated writes are reachable by
|
|
12
|
+
// any authenticated caller for any row.
|
|
13
|
+
ownership: customerOwnership(),
|
|
14
|
+
|
|
10
15
|
traits: {
|
|
11
16
|
useUuid: true,
|
|
12
17
|
useTimestamps: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineModel } from '@stacksjs/orm'
|
|
1
|
+
import { customerOwnership, defineModel } from '@stacksjs/orm'
|
|
2
2
|
import { schema } from '@stacksjs/validation'
|
|
3
3
|
|
|
4
4
|
export default defineModel({
|
|
@@ -7,6 +7,11 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// Rows belong to the caller's customer record, one hop from the user
|
|
11
|
+
// (stacksjs/stacks#2375). Without this the generated writes are reachable by
|
|
12
|
+
// any authenticated caller for any row.
|
|
13
|
+
ownership: customerOwnership(),
|
|
14
|
+
|
|
10
15
|
traits: {
|
|
11
16
|
useUuid: true,
|
|
12
17
|
useTimestamps: true,
|
|
@@ -7,6 +7,12 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
hasMany: ['Receipt'],
|
|
10
|
+
// A reference table: no row here has a per-caller owner, so there is nothing
|
|
11
|
+
// to scope by and writes are an administrative concern gated by `middleware`.
|
|
12
|
+
// Declared rather than left silent so `security.api.rowScoping: 'deny'` can
|
|
13
|
+
// tell "considered" from "nobody thought about it" (stacksjs/stacks#2375).
|
|
14
|
+
ownership: false,
|
|
15
|
+
|
|
10
16
|
traits: {
|
|
11
17
|
useUuid: true,
|
|
12
18
|
useTimestamps: true,
|
|
@@ -7,6 +7,12 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// A reference table: no row here has a per-caller owner, so there is nothing
|
|
11
|
+
// to scope by and writes are an administrative concern gated by `middleware`.
|
|
12
|
+
// Declared rather than left silent so `security.api.rowScoping: 'deny'` can
|
|
13
|
+
// tell "considered" from "nobody thought about it" (stacksjs/stacks#2375).
|
|
14
|
+
ownership: false,
|
|
15
|
+
|
|
10
16
|
traits: {
|
|
11
17
|
useUuid: true,
|
|
12
18
|
useTimestamps: true,
|
|
@@ -7,6 +7,12 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// A reference table: no row here has a per-caller owner, so there is nothing
|
|
11
|
+
// to scope by and writes are an administrative concern gated by `middleware`.
|
|
12
|
+
// Declared rather than left silent so `security.api.rowScoping: 'deny'` can
|
|
13
|
+
// tell "considered" from "nobody thought about it" (stacksjs/stacks#2375).
|
|
14
|
+
ownership: false,
|
|
15
|
+
|
|
10
16
|
traits: {
|
|
11
17
|
useUuid: true,
|
|
12
18
|
useTimestamps: true,
|
|
@@ -7,6 +7,12 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// A reference table: no row here has a per-caller owner, so there is nothing
|
|
11
|
+
// to scope by and writes are an administrative concern gated by `middleware`.
|
|
12
|
+
// Declared rather than left silent so `security.api.rowScoping: 'deny'` can
|
|
13
|
+
// tell "considered" from "nobody thought about it" (stacksjs/stacks#2375).
|
|
14
|
+
ownership: false,
|
|
15
|
+
|
|
10
16
|
traits: {
|
|
11
17
|
useUuid: true,
|
|
12
18
|
useTimestamps: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineModel } from '@stacksjs/orm'
|
|
1
|
+
import { customerOwnership, defineModel } from '@stacksjs/orm'
|
|
2
2
|
import { schema } from '@stacksjs/validation'
|
|
3
3
|
|
|
4
4
|
export default defineModel({
|
|
@@ -7,6 +7,11 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// Rows belong to the caller's customer record, one hop from the user
|
|
11
|
+
// (stacksjs/stacks#2375). Without this the generated writes are reachable by
|
|
12
|
+
// any authenticated caller for any row.
|
|
13
|
+
ownership: customerOwnership(),
|
|
14
|
+
|
|
10
15
|
traits: {
|
|
11
16
|
useUuid: true,
|
|
12
17
|
useTimestamps: true,
|
|
@@ -7,6 +7,12 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// A reference table: no row here has a per-caller owner, so there is nothing
|
|
11
|
+
// to scope by and writes are an administrative concern gated by `middleware`.
|
|
12
|
+
// Declared rather than left silent so `security.api.rowScoping: 'deny'` can
|
|
13
|
+
// tell "considered" from "nobody thought about it" (stacksjs/stacks#2375).
|
|
14
|
+
ownership: false,
|
|
15
|
+
|
|
10
16
|
traits: {
|
|
11
17
|
useUuid: true,
|
|
12
18
|
useTimestamps: true,
|
|
@@ -7,6 +7,12 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// A reference table: no row here has a per-caller owner, so there is nothing
|
|
11
|
+
// to scope by and writes are an administrative concern gated by `middleware`.
|
|
12
|
+
// Declared rather than left silent so `security.api.rowScoping: 'deny'` can
|
|
13
|
+
// tell "considered" from "nobody thought about it" (stacksjs/stacks#2375).
|
|
14
|
+
ownership: false,
|
|
15
|
+
|
|
10
16
|
traits: {
|
|
11
17
|
useUuid: true,
|
|
12
18
|
useTimestamps: true,
|
|
@@ -7,6 +7,12 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// A reference table: no row here has a per-caller owner, so there is nothing
|
|
11
|
+
// to scope by and writes are an administrative concern gated by `middleware`.
|
|
12
|
+
// Declared rather than left silent so `security.api.rowScoping: 'deny'` can
|
|
13
|
+
// tell "considered" from "nobody thought about it" (stacksjs/stacks#2375).
|
|
14
|
+
ownership: false,
|
|
15
|
+
|
|
10
16
|
traits: {
|
|
11
17
|
useUuid: true,
|
|
12
18
|
useTimestamps: true,
|
|
@@ -7,6 +7,12 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// A reference table: no row here has a per-caller owner, so there is nothing
|
|
11
|
+
// to scope by and writes are an administrative concern gated by `middleware`.
|
|
12
|
+
// Declared rather than left silent so `security.api.rowScoping: 'deny'` can
|
|
13
|
+
// tell "considered" from "nobody thought about it" (stacksjs/stacks#2375).
|
|
14
|
+
ownership: false,
|
|
15
|
+
|
|
10
16
|
traits: {
|
|
11
17
|
useUuid: true,
|
|
12
18
|
useTimestamps: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineModel } from '@stacksjs/orm'
|
|
1
|
+
import { defineModel, parentOwnership } from '@stacksjs/orm'
|
|
2
2
|
import { schema } from '@stacksjs/validation'
|
|
3
3
|
|
|
4
4
|
export default defineModel({
|
|
@@ -7,6 +7,11 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// No owner of its own: these rows are owned by whoever owns the order's customer
|
|
11
|
+
// (stacksjs/stacks#2375). Resolved through the parent so it follows any change
|
|
12
|
+
// to how Order decides ownership.
|
|
13
|
+
ownership: parentOwnership('Order', 'order_id'),
|
|
14
|
+
|
|
10
15
|
traits: {
|
|
11
16
|
useUuid: true,
|
|
12
17
|
useTimestamps: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineModel } from '@stacksjs/orm'
|
|
1
|
+
import { customerOwnership, defineModel } from '@stacksjs/orm'
|
|
2
2
|
import { schema } from '@stacksjs/validation'
|
|
3
3
|
|
|
4
4
|
export default defineModel({
|
|
@@ -7,6 +7,11 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
belongsTo: ['Product', 'Customer'],
|
|
10
|
+
// Rows belong to the caller's customer record, one hop from the user
|
|
11
|
+
// (stacksjs/stacks#2375). Without this the generated writes are reachable by
|
|
12
|
+
// any authenticated caller for any row.
|
|
13
|
+
ownership: customerOwnership(),
|
|
14
|
+
|
|
10
15
|
traits: {
|
|
11
16
|
useUuid: true,
|
|
12
17
|
useTimestamps: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineModel } from '@stacksjs/orm'
|
|
1
|
+
import { customerOwnership, defineModel } from '@stacksjs/orm'
|
|
2
2
|
import { schema } from '@stacksjs/validation'
|
|
3
3
|
|
|
4
4
|
export default defineModel({
|
|
@@ -7,6 +7,11 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
belongsTo: ['Customer'],
|
|
10
|
+
// Rows belong to the caller's customer record, one hop from the user
|
|
11
|
+
// (stacksjs/stacks#2375). Without this the generated writes are reachable by
|
|
12
|
+
// any authenticated caller for any row.
|
|
13
|
+
ownership: customerOwnership(),
|
|
14
|
+
|
|
10
15
|
traits: {
|
|
11
16
|
useUuid: true,
|
|
12
17
|
useTimestamps: true,
|
|
@@ -7,6 +7,11 @@ export default defineModel({
|
|
|
7
7
|
primaryKey: 'id',
|
|
8
8
|
autoIncrement: true,
|
|
9
9
|
|
|
10
|
+
// An infrastructure table: rows are written by the system, not on behalf of a
|
|
11
|
+
// caller, so no row has a per-caller owner to scope by. Writes are gated by
|
|
12
|
+
// `middleware` instead. Declared rather than left silent (stacksjs/stacks#2375).
|
|
13
|
+
ownership: false,
|
|
14
|
+
|
|
10
15
|
traits: {
|
|
11
16
|
useTimestamps: true,
|
|
12
17
|
useSeeder: {
|
package/ide/vscode/package.json
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/defaults",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.74.
|
|
5
|
+
"version": "0.74.3",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@iconify-json/f7": "^1.2.2",
|
|
56
56
|
"@iconify-json/hugeicons": "^1.2.27",
|
|
57
|
-
"@stacksjs/mobile": "^0.74.
|
|
57
|
+
"@stacksjs/mobile": "^0.74.3",
|
|
58
58
|
"@stacksjs/sanitizer": "^0.2.113",
|
|
59
59
|
"ts-qr-codes": "^0.1.8"
|
|
60
60
|
}
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
"compilerOptions": {
|
|
7
7
|
"lib": ["esnext", "dom"],
|
|
8
8
|
"rootDir": "../..",
|
|
9
|
-
|
|
9
|
+
// Not incremental, for the reason spelled out in tsconfig.app.json: the
|
|
10
|
+
// cache reports a false green after the auto-import barrels are
|
|
11
|
+
// regenerated. stacksjs/stacks#2405.
|
|
12
|
+
"incremental": false,
|
|
10
13
|
"paths": {
|
|
11
14
|
"Actions/*": ["../../app/Actions/*"],
|
|
12
15
|
"Commands/*": ["../../app/Commands/*"],
|