Skip to content

Commit e0c926a

Browse files
author
Tom Kirkpatrick
committed
feat: update to support loopback 3.x
1 parent d3a43ad commit e0c926a

18 files changed

+83
-57
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"lodash": "^4.17.4"
3939
},
4040
"peerDependencies": {
41-
"loopback": "^2.25.0",
4241
"loopback-context": "^3.1.0",
4342
"cls-hooked": "^4.1.5"
4443
},
@@ -51,7 +50,7 @@
5150
"dirty-chai": "2.0.1",
5251
"eslint": "^4.1.0",
5352
"eslint-config-fullcube": "^3.0.0",
54-
"loopback": "^2.25.0",
53+
"loopback": "^3.4.0",
5554
"loopback-boot": "^2.24.0",
5655
"loopback-component-explorer": "2.3.0",
5756
"loopback-context": "^3.1.0",
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "accessToken",
3+
"plural": "accessTokens",
4+
"base": "AccessToken",
5+
"relations": {
6+
"user": {
7+
"type": "belongsTo",
8+
"model": "user",
9+
"foreignKey": "userId"
10+
}
11+
}
12+
}

test/fixtures/simple-app/common/models/invoice.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/fixtures/simple-app/common/models/invoice.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"name": "Invoice",
33
"base": "PersistedModel",
4-
"idInjection": true,
54
"options": {
6-
"validateUpsert": true
5+
"idInjection": true,
6+
"validateUpsert": true,
7+
"forceId": false,
8+
"replaceOnPUT": false
79
},
810
"properties": {
911
"storeId": {
@@ -59,14 +61,7 @@
5961
"principalType": "ROLE",
6062
"principalId": "$group:manager",
6163
"permission": "ALLOW",
62-
"property": "updateAttributes"
63-
},
64-
{
65-
"accessType": "WRITE",
66-
"principalType": "ROLE",
67-
"principalId": "$group:manager",
68-
"permission": "ALLOW",
69-
"property": "upsert"
64+
"property": ["patchOrCreate", "replaceOrCreate", "replaceById", "updateOrCreate", "updateAttributes", "patchAttributes"]
7065
},
7166
{
7267
"accessType": "*",

test/fixtures/simple-app/common/models/store.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/fixtures/simple-app/common/models/store.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"name": "Store",
33
"base": "PersistedModel",
4-
"idInjection": true,
54
"options": {
6-
"validateUpsert": true
5+
"idInjection": true,
6+
"validateUpsert": true,
7+
"forceId": false,
8+
"replaceOnPUT": false
79
},
810
"properties": {
911
"id": {

test/fixtures/simple-app/common/models/team.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/fixtures/simple-app/common/models/team.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"name": "Team",
33
"base": "PersistedModel",
4-
"idInjection": true,
54
"options": {
6-
"validateUpsert": true
5+
"idInjection": true,
6+
"validateUpsert": true,
7+
"forceId": false,
8+
"replaceOnPUT": false
79
},
810
"properties": {
911
"storeId": {

test/fixtures/simple-app/common/models/transaction.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/fixtures/simple-app/common/models/transaction.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"name": "Transaction",
33
"base": "PersistedModel",
4-
"idInjection": true,
54
"options": {
6-
"validateUpsert": true
5+
"idInjection": true,
6+
"validateUpsert": true,
7+
"forceId": false,
8+
"replaceOnPUT": false
79
},
810
"properties": {
911
"storeId": {

0 commit comments

Comments
 (0)