@fraym/projections 0.12.0 → 0.12.1

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.
@@ -17,7 +17,7 @@ const run = async () => {
17
17
  .config({
18
18
  schemaGlob: "./src/**/*.graphql",
19
19
  permissionsSchemaGlob: "",
20
- serverAddress: "127.0.0.1:9000",
20
+ serverAddress: "http://127.0.0.1",
21
21
  apiToken: "",
22
22
  namespace: "",
23
23
  })
@@ -8,6 +8,9 @@ const getAllProjections = async (config) => {
8
8
  Authorization: `Bearer ${config.apiToken}`,
9
9
  },
10
10
  });
11
+ if (!response.ok) {
12
+ throw new Error(await response.text());
13
+ }
11
14
  const data = await response.json();
12
15
  return data.projectionNames;
13
16
  };
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.removeProjections = void 0;
4
4
  const removeProjections = async (projectionNames, config) => {
5
- await fetch(`${config.serverAddress}/management/projections`, {
5
+ const response = await fetch(`${config.serverAddress}/management/projections`, {
6
6
  method: "DELETE",
7
7
  headers: {
8
8
  Authorization: `Bearer ${config.apiToken}`,
@@ -12,5 +12,8 @@ const removeProjections = async (projectionNames, config) => {
12
12
  projectionNames,
13
13
  }),
14
14
  });
15
+ if (!response.ok) {
16
+ throw new Error(await response.text());
17
+ }
15
18
  };
16
19
  exports.removeProjections = removeProjections;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.upsertProjections = void 0;
4
4
  const upsertProjections = async (schema, config) => {
5
- await fetch(`${config.serverAddress}/management/projections`, {
5
+ const response = await fetch(`${config.serverAddress}/management/projections`, {
6
6
  method: "POST",
7
7
  headers: {
8
8
  Authorization: `Bearer ${config.apiToken}`,
@@ -12,5 +12,8 @@ const upsertProjections = async (schema, config) => {
12
12
  schema,
13
13
  }),
14
14
  });
15
+ if (!response.ok) {
16
+ throw new Error(await response.text());
17
+ }
15
18
  };
16
19
  exports.upsertProjections = upsertProjections;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fraym/projections",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "license": "UNLICENSED",
5
5
  "homepage": "https://github.com/fraym/projections-nodejs",
6
6
  "repository": {