@devite/shopware-client 1.7.4 → 1.7.5

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/dist/index.cjs CHANGED
@@ -1272,21 +1272,21 @@ class WebhookClient extends Client {
1272
1272
  }
1273
1273
 
1274
1274
  class AdminShopwareClient extends ShopwareClient {
1275
- clientId = null;
1276
- constructor(baseUrl) {
1275
+ clientId;
1276
+ constructor(baseUrl, clientId) {
1277
1277
  super(baseUrl + "/api");
1278
+ this.clientId = clientId;
1278
1279
  }
1279
1280
  async doRequest(path, options) {
1280
1281
  return await super.doRequest(path, await this.withOAuth(options));
1281
1282
  }
1282
- async authenticateAsClient(clientId, clientSecret, scopes) {
1283
- this.clientId = clientId;
1283
+ async authenticateAsClient(clientSecret, scope) {
1284
1284
  const authResponse = await super.doRequest("/oauth/token", {
1285
1285
  method: HTTPRequestMethod.POST,
1286
1286
  body: new JsonPayload({
1287
1287
  grant_type: "client_credentials",
1288
- scopes,
1289
- client_id: clientId,
1288
+ scope,
1289
+ client_id: this.clientId,
1290
1290
  client_secret: clientSecret
1291
1291
  })
1292
1292
  });
@@ -1294,14 +1294,14 @@ class AdminShopwareClient extends ShopwareClient {
1294
1294
  throw new ShopwareError("Authentication as client failed", authResponse);
1295
1295
  this.authStore.getOrCreateEntry(new OAuthEntry()).save(authResponse);
1296
1296
  }
1297
- async authenticateAsUser(username, password, scopes) {
1297
+ async authenticateAsUser(username, password, scope) {
1298
1298
  this.clientId = "administration";
1299
1299
  const authResponse = await super.doRequest("/oauth/token", {
1300
1300
  method: HTTPRequestMethod.POST,
1301
1301
  body: new JsonPayload({
1302
1302
  grant_type: "password",
1303
1303
  client_id: this.clientId,
1304
- scopes,
1304
+ scope,
1305
1305
  username,
1306
1306
  password
1307
1307
  })
package/dist/index.d.cts CHANGED
@@ -5720,11 +5720,11 @@ declare class WebhookClient extends Client {
5720
5720
  }
5721
5721
 
5722
5722
  declare class AdminShopwareClient extends ShopwareClient {
5723
- private clientId;
5724
- constructor(baseUrl: string);
5723
+ clientId: string | "administration";
5724
+ constructor(baseUrl: string, clientId: string | "administration");
5725
5725
  doRequest(path: string, options?: ClientRequestOptions): Promise<ClientResponse>;
5726
- authenticateAsClient(clientId: string, clientSecret: string, scopes: OAuthScope): Promise<void>;
5727
- authenticateAsUser(username: string, password: string, scopes: OAuthScope): Promise<void>;
5726
+ authenticateAsClient(clientSecret: string, scope: OAuthScope): Promise<void>;
5727
+ authenticateAsUser(username: string, password: string, scope: OAuthScope): Promise<void>;
5728
5728
  private withOAuth;
5729
5729
  forApp(): AppClient;
5730
5730
  forCategory(): CategoryClient$1;
package/dist/index.d.mts CHANGED
@@ -5720,11 +5720,11 @@ declare class WebhookClient extends Client {
5720
5720
  }
5721
5721
 
5722
5722
  declare class AdminShopwareClient extends ShopwareClient {
5723
- private clientId;
5724
- constructor(baseUrl: string);
5723
+ clientId: string | "administration";
5724
+ constructor(baseUrl: string, clientId: string | "administration");
5725
5725
  doRequest(path: string, options?: ClientRequestOptions): Promise<ClientResponse>;
5726
- authenticateAsClient(clientId: string, clientSecret: string, scopes: OAuthScope): Promise<void>;
5727
- authenticateAsUser(username: string, password: string, scopes: OAuthScope): Promise<void>;
5726
+ authenticateAsClient(clientSecret: string, scope: OAuthScope): Promise<void>;
5727
+ authenticateAsUser(username: string, password: string, scope: OAuthScope): Promise<void>;
5728
5728
  private withOAuth;
5729
5729
  forApp(): AppClient;
5730
5730
  forCategory(): CategoryClient$1;
package/dist/index.d.ts CHANGED
@@ -5720,11 +5720,11 @@ declare class WebhookClient extends Client {
5720
5720
  }
5721
5721
 
5722
5722
  declare class AdminShopwareClient extends ShopwareClient {
5723
- private clientId;
5724
- constructor(baseUrl: string);
5723
+ clientId: string | "administration";
5724
+ constructor(baseUrl: string, clientId: string | "administration");
5725
5725
  doRequest(path: string, options?: ClientRequestOptions): Promise<ClientResponse>;
5726
- authenticateAsClient(clientId: string, clientSecret: string, scopes: OAuthScope): Promise<void>;
5727
- authenticateAsUser(username: string, password: string, scopes: OAuthScope): Promise<void>;
5726
+ authenticateAsClient(clientSecret: string, scope: OAuthScope): Promise<void>;
5727
+ authenticateAsUser(username: string, password: string, scope: OAuthScope): Promise<void>;
5728
5728
  private withOAuth;
5729
5729
  forApp(): AppClient;
5730
5730
  forCategory(): CategoryClient$1;
package/dist/index.mjs CHANGED
@@ -1270,21 +1270,21 @@ class WebhookClient extends Client {
1270
1270
  }
1271
1271
 
1272
1272
  class AdminShopwareClient extends ShopwareClient {
1273
- clientId = null;
1274
- constructor(baseUrl) {
1273
+ clientId;
1274
+ constructor(baseUrl, clientId) {
1275
1275
  super(baseUrl + "/api");
1276
+ this.clientId = clientId;
1276
1277
  }
1277
1278
  async doRequest(path, options) {
1278
1279
  return await super.doRequest(path, await this.withOAuth(options));
1279
1280
  }
1280
- async authenticateAsClient(clientId, clientSecret, scopes) {
1281
- this.clientId = clientId;
1281
+ async authenticateAsClient(clientSecret, scope) {
1282
1282
  const authResponse = await super.doRequest("/oauth/token", {
1283
1283
  method: HTTPRequestMethod.POST,
1284
1284
  body: new JsonPayload({
1285
1285
  grant_type: "client_credentials",
1286
- scopes,
1287
- client_id: clientId,
1286
+ scope,
1287
+ client_id: this.clientId,
1288
1288
  client_secret: clientSecret
1289
1289
  })
1290
1290
  });
@@ -1292,14 +1292,14 @@ class AdminShopwareClient extends ShopwareClient {
1292
1292
  throw new ShopwareError("Authentication as client failed", authResponse);
1293
1293
  this.authStore.getOrCreateEntry(new OAuthEntry()).save(authResponse);
1294
1294
  }
1295
- async authenticateAsUser(username, password, scopes) {
1295
+ async authenticateAsUser(username, password, scope) {
1296
1296
  this.clientId = "administration";
1297
1297
  const authResponse = await super.doRequest("/oauth/token", {
1298
1298
  method: HTTPRequestMethod.POST,
1299
1299
  body: new JsonPayload({
1300
1300
  grant_type: "password",
1301
1301
  client_id: this.clientId,
1302
- scopes,
1302
+ scope,
1303
1303
  username,
1304
1304
  password
1305
1305
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devite/shopware-client",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
4
4
  "description": "Third party API client for Shopware 6.",
5
5
  "repository": "devite-io/shopware-client",
6
6
  "license": "MIT",
@@ -41,13 +41,13 @@
41
41
  "dist"
42
42
  ],
43
43
  "devDependencies": {
44
- "@types/node": "^22.15.12",
44
+ "@types/node": "^22.16.5",
45
45
  "changelogen": "^0.5.7",
46
- "eslint": "^9.26.0",
47
- "prettier": "^3.5.3",
46
+ "eslint": "^9.32.0",
47
+ "prettier": "^3.6.2",
48
48
  "typescript": "^5.8.3",
49
- "typescript-eslint": "^8.32.0",
50
- "unbuild": "^3.5.0",
49
+ "typescript-eslint": "^8.38.0",
50
+ "unbuild": "^3.6.0",
51
51
  "vitest": "^2.1.9"
52
52
  },
53
53
  "dependencies": {