@vendure/core 3.7.2-master-202607180305 → 3.7.2-master-202607210306
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.
|
@@ -26,6 +26,25 @@ export declare class RequestContextService {
|
|
|
26
26
|
* with services outside the request-response cycle, for example in stand-alone scripts or in
|
|
27
27
|
* worker jobs.
|
|
28
28
|
*
|
|
29
|
+
* Without a `user`, the resulting context is anonymous and carries no permissions, which
|
|
30
|
+
* services that perform permission checks will reject. Pass the `User` the context should act
|
|
31
|
+
* as — commonly the superadmin for administrative scripts:
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* const { superadminCredentials } = this.configService.authOptions;
|
|
35
|
+
* const superAdminUser = await this.connection.rawConnection.getRepository(User).findOneOrFail({
|
|
36
|
+
* where: { identifier: superadminCredentials.identifier },
|
|
37
|
+
* // The roles (and their channels) must be loaded, or the resulting context
|
|
38
|
+
* // has the user's id but no permissions.
|
|
39
|
+
* relations: { roles: { channels: true } },
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* const ctx = await this.requestContextService.create({
|
|
43
|
+
* apiType: 'admin',
|
|
44
|
+
* user: superAdminUser,
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
29
48
|
* @since 1.5.0
|
|
30
49
|
*/
|
|
31
50
|
create(config: {
|
|
@@ -42,6 +42,25 @@ let RequestContextService = class RequestContextService {
|
|
|
42
42
|
* with services outside the request-response cycle, for example in stand-alone scripts or in
|
|
43
43
|
* worker jobs.
|
|
44
44
|
*
|
|
45
|
+
* Without a `user`, the resulting context is anonymous and carries no permissions, which
|
|
46
|
+
* services that perform permission checks will reject. Pass the `User` the context should act
|
|
47
|
+
* as — commonly the superadmin for administrative scripts:
|
|
48
|
+
*
|
|
49
|
+
* ```ts
|
|
50
|
+
* const { superadminCredentials } = this.configService.authOptions;
|
|
51
|
+
* const superAdminUser = await this.connection.rawConnection.getRepository(User).findOneOrFail({
|
|
52
|
+
* where: { identifier: superadminCredentials.identifier },
|
|
53
|
+
* // The roles (and their channels) must be loaded, or the resulting context
|
|
54
|
+
* // has the user's id but no permissions.
|
|
55
|
+
* relations: { roles: { channels: true } },
|
|
56
|
+
* });
|
|
57
|
+
*
|
|
58
|
+
* const ctx = await this.requestContextService.create({
|
|
59
|
+
* apiType: 'admin',
|
|
60
|
+
* user: superAdminUser,
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
45
64
|
* @since 1.5.0
|
|
46
65
|
*/
|
|
47
66
|
async create(config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-context.service.js","sourceRoot":"","sources":["../../../../src/service/helpers/request-context/request-context.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yEAA6F;AAI7F,4CAAoB;AAEpB,mEAAuE;AACvE,yEAAqE;AACrE,yDAA8D;AAC9D,iDAAoD;AACpD,mEAA+D;AAE/D,2EAAiE;AAEjE,oEAAgE;AAChE,0FAAoF;AAEpF;;;;;GAKG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAC9B,gBAAgB;IAChB,YACY,cAA8B,EAC9B,aAA4B;QAD5B,mBAAc,GAAd,cAAc,CAAgB;QAC9B,kBAAa,GAAb,aAAa,CAAe;IACrC,CAAC;IAEJ
|
|
1
|
+
{"version":3,"file":"request-context.service.js","sourceRoot":"","sources":["../../../../src/service/helpers/request-context/request-context.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yEAA6F;AAI7F,4CAAoB;AAEpB,mEAAuE;AACvE,yEAAqE;AACrE,yDAA8D;AAC9D,iDAAoD;AACpD,mEAA+D;AAE/D,2EAAiE;AAEjE,oEAAgE;AAChE,0FAAoF;AAEpF;;;;;GAKG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAC9B,gBAAgB;IAChB,YACY,cAA8B,EAC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jB,iBAAiB,cAAjB,iBAAiB,GAAI,OAAO,CAAC,mBAAmB,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACK,mCAAmC,CACvC,cAA4B,EAAE,EAC9B,OAAiB,EACjB,IAAwB;QAExB,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,MAAM,oBAAoB,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,mBAAW,EAAC,CAAC,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9F,IAAI,oBAAoB,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QAC/E,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;OAEG;IACK,eAAe,CAAI,IAAS,EAAE,IAAS;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE;YACpC,OAAO,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC7C,CAAC,EAAE,KAAgB,CAAC,CAAC;IACzB,CAAC;CACJ,CAAA;AAlLY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAImB,gCAAc;QACf,8BAAa;GAJ/B,qBAAqB,CAkLjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendure/core",
|
|
3
|
-
"version": "3.7.2-master-
|
|
3
|
+
"version": "3.7.2-master-202607210306",
|
|
4
4
|
"description": "A modern, headless ecommerce framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@nestjs/platform-express": "^11.0.12",
|
|
50
50
|
"@nestjs/typeorm": "^11.0.0",
|
|
51
51
|
"@types/express": "^5.0.1",
|
|
52
|
-
"@vendure/common": "^3.7.2-master-
|
|
52
|
+
"@vendure/common": "^3.7.2-master-202607210306",
|
|
53
53
|
"bcrypt": "^6.0.0",
|
|
54
54
|
"cookie-session": "^2.1.0",
|
|
55
55
|
"cron-time-generator": "^2.0.3",
|