@epilot/email-settings-client 0.0.3 → 0.0.6

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/README.md CHANGED
@@ -1,43 +1,30 @@
1
- # `@epilot/email-settings-client`
1
+ # @epilot/email-settings-client
2
2
 
3
- API Client for epilot email-settings API.
3
+ [![CI](https://github.com/epilot-dev/sdk-js/workflows/CI/badge.svg)](https://github.com/epilot-dev/sdk-js/actions?query=workflow%3ACI)
4
+ [![npm version](https://img.shields.io/npm/v/@epilot/email-settings-client.svg)](https://www.npmjs.com/package/@epilot/email-settings-client)
5
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/@epilot/email-settings-client?label=gzip%20bundle)](https://bundlephobia.com/package/@epilot/email-settings-client)
6
+ [![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/epilot-dev/sdk-js/blob/main/LICENSE)
4
7
 
5
- Uses [`openapi-client-axios`](https://github.com/anttiviljami/openapi-client-axios)
8
+ API Client for epilot [Email Settings API](https://docs.epilot.io/api/email-settings).
6
9
 
7
- ## Getting Started
10
+ Uses [`openapi-client-axios`](https://github.com/anttiviljami/openapi-client-axios)
8
11
 
9
- Install the package:
12
+ ## Installation
10
13
 
11
14
  ```bash
12
- npm install --save-dev @epilot/email-settings-client
15
+ npm install --save @epilot/email-settings-client
13
16
  ```
14
17
 
15
- Import the package:
18
+ ## Usage
16
19
 
17
20
  ```typescript
18
21
  import { getClient } from '@epilot/email-settings-client';
19
- ```
20
-
21
- Use the client:
22
- ```typescript
23
- // get typed client
24
- const client = await getClient();
22
+ const emailSettingsClient = getClient();
25
23
 
26
- // call an operation
27
- const res = await client.testS3();
24
+ const getResponse = await emailSettingsClient.getSettings({ type: 'signature', id: 'a10bd0ff-4391-4cfc-88ee-b19d718a9bf7' });
28
25
  ```
29
26
 
30
- ## BaseURL & Authorization
31
-
32
- To pass an authorization header and set up the API url, you can use axios
33
- defaults:
34
-
35
- ```typescript
36
- const client = getClient();
37
- client.defaults.baseURL = config.API_URL;
38
- client.defaults.headers['authorization'] = `Bearer ${token}`;
39
- ```
27
+ ## Documentation
40
28
 
41
- ## API Docs:
29
+ https://docs.epilot.io/docs/messaging/email-settings
42
30
 
43
- https://docs.api.epilot.io/
package/dist/client.js CHANGED
@@ -1,14 +1,29 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
5
16
  Object.defineProperty(exports, "__esModule", { value: true });
6
17
  exports.getClient = void 0;
18
+ var lambda_powertools_correlation_ids_1 = __importDefault(require("@dazn/lambda-powertools-correlation-ids"));
7
19
  var openapi_client_axios_1 = __importDefault(require("openapi-client-axios"));
8
20
  var definition_1 = __importDefault(require("./definition"));
9
21
  var getClient = function () {
22
+ var _a;
10
23
  var api = new openapi_client_axios_1.default({ definition: definition_1.default, quick: true });
11
- return api.initSync();
24
+ var apiClient = api.initSync();
25
+ apiClient.defaults.headers.common = __assign(__assign({}, ((_a = apiClient.defaults.headers.common) !== null && _a !== void 0 ? _a : {})), (lambda_powertools_correlation_ids_1.default.get() || {}));
26
+ return apiClient;
12
27
  };
13
28
  exports.getClient = getClient;
14
29
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- !function(e,t){for(var s in t)e[s]=t[s];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,s){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=i(s(279));t.default=n.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Email settings API","version":"1.0.0"},"tags":[{"name":"Email settings","description":"Email settings service"}],"security":[{"EpilotAuth":[]},{"AsOrganization":[]},{"EpilotOrg":[]}],"paths":{"/v1/email-settings":{"get":{"operationId":"getSettings","summary":"getSettings","description":"Get all settings by type","tags":["Settings"],"parameters":[{"name":"type","description":"Setting types:\\n* signature\\n* email_domain\\n* email_address\\n","in":"query","required":true,"schema":{"type":"string","enum":["signature","email_domain","email_address","whitelist_email_address"]},"example":"signature"},{"name":"id","description":"ID of setting","in":"query","schema":{"type":"string"},"example":"a10bd0ff-4391-4cfc-88ee-b19d718a9bf7"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"post":{"operationId":"addSetting","summary":"addSetting","description":"Add setting","tags":["Settings"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"operationId":"deleteSetting","summary":"deleteSetting","description":"delete setting by ID and type","tags":["Settings"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["id","type"],"properties":{"type":{"type":"string","example":"signature","enum":["signature","email_domain","email_address","whitelist_email_address"]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/v1/email-settings/{id}":{"post":{"operationId":"updateSetting","summary":"updateSetting","description":"Update setting by ID","tags":["Settings"],"parameters":[{"name":"id","description":"ID of setting","in":"path","required":true,"schema":{"type":"string"},"example":"a10bd0ff-4391-4cfc-88ee-b19d718a9bf7"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/v1/email-settings/domain":{"post":{"operationId":"addDomain","summary":"addDomain","description":"Add domain","tags":["Domains"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"operationId":"deleteDomain","summary":"deleteDomain","description":"Delete domain","tags":["Domains"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/v1/email-settings/domain/name-servers:verify":{"post":{"operationId":"verifyNameServers","summary":"verifyNameServers","description":"Verify name servers","tags":["Domains"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/v1/email-settings/domain:verify":{"post":{"operationId":"verifyDomain","summary":"verifyDomain","description":"Verify domain","tags":["Domains"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Authorization header with epilot OAuth2 bearer token","bearerFormat":"JWT"},"AsOrganization":{"type":"apiKey","in":"header","name":"x-ivy-org-id","description":"Set organization id when using internal auth"},"EpilotOrg":{"description":"Overrides the target organization to allow shared tenant access","name":"x-epilot-org-id","in":"header","type":"apiKey"}},"schemas":{"SettingsResponse":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}},"Setting":{"type":"object","required":["type"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"org_id":{"type":"string"},"type":{"type":"string","example":"signature","enum":["signature","email_domain","email_address","whitelist_email_address"]},"html":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"string"},"updated_by":{"type":"string"}},"additionalProperties":true},"Domain":{"type":"object","properties":{"domain":{"type":"string","example":"subdomain.epilot.cloud"}}}}}}')}},t={};return function s(i){if(t[i])return t[i].exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,s),n.exports}(914)})());
1
+ !function(e,t){for(var s in t)e[s]=t[s];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,s){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=i(s(279));t.default=n.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Email settings API","version":"1.0.0"},"tags":[{"name":"Email settings","description":"Email settings service"}],"security":[{"EpilotAuth":[]},{"AsOrganization":[]},{"EpilotOrg":[]}],"paths":{"/v1/email-settings":{"get":{"operationId":"getSettings","summary":"getSettings","description":"Get all settings by type","tags":["Settings"],"parameters":[{"name":"type","description":"Setting types:\\n* signature\\n* email_domain\\n* email_address\\n","in":"query","required":true,"schema":{"type":"string","enum":["signature","email_domain","email_address","whitelist_email_address"]},"example":"signature"},{"name":"id","description":"ID of setting","in":"query","schema":{"type":"string"},"example":"a10bd0ff-4391-4cfc-88ee-b19d718a9bf7"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"post":{"operationId":"addSetting","summary":"addSetting","description":"Add setting","tags":["Settings"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"operationId":"deleteSetting","summary":"deleteSetting","description":"delete setting by ID and type","tags":["Settings"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["id","type"],"properties":{"type":{"type":"string","example":"signature","enum":["signature","email_domain","email_address","whitelist_email_address"]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/v1/email-settings/{id}":{"post":{"operationId":"updateSetting","summary":"updateSetting","description":"Update setting by ID","tags":["Settings"],"parameters":[{"name":"id","description":"ID of setting","in":"path","required":true,"schema":{"type":"string"},"example":"a10bd0ff-4391-4cfc-88ee-b19d718a9bf7"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/v1/email-settings/domain":{"post":{"operationId":"addDomain","summary":"addDomain","description":"Add domain","tags":["Domains"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}},"delete":{"operationId":"deleteDomain","summary":"deleteDomain","description":"Delete domain","tags":["Domains"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"responses":{"204":{"description":"Success"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/v1/email-settings/domain/name-servers:verify":{"post":{"operationId":"verifyNameServers","summary":"verifyNameServers","description":"Verify name servers","tags":["Domains"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/v1/email-settings/domain:verify":{"post":{"operationId":"verifyDomain","summary":"verifyDomain","description":"Verify domain","tags":["Domains"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Authorization header with epilot OAuth2 bearer token","bearerFormat":"JWT"},"AsOrganization":{"type":"apiKey","in":"header","name":"x-ivy-org-id","description":"Set organization id when using internal auth"},"EpilotOrg":{"description":"Overrides the target organization to allow shared tenant access","name":"x-epilot-org-id","in":"header","type":"apiKey"}},"schemas":{"SettingsResponse":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}},"Setting":{"type":"object","required":["type"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"org_id":{"type":"string"},"type":{"type":"string","example":"signature","enum":["signature","email_domain","email_address","whitelist_email_address"]},"html":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"string"},"updated_by":{"type":"string"}},"additionalProperties":true},"Domain":{"type":"object","properties":{"domain":{"type":"string","example":"subdomain.epilot.cloud"}}}}},"servers":[{"url":"https://email-settings.sls.epilot.io"},{"url":"https://email-settings.sls.epilot.io"}]}')}},t={};return function s(i){if(t[i])return t[i].exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,s),n.exports}(914)})());
package/package.json CHANGED
@@ -1,18 +1,33 @@
1
1
  {
2
2
  "name": "@epilot/email-settings-client",
3
- "version": "0.0.3",
4
- "description": "API Client for epilot email-settings API",
3
+ "version": "0.0.6",
4
+ "description": "API Client for epilot Email Settings API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/epilot-dev/sdk-js.git",
10
+ "directory": "clients/email-setting-client"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/epilot-dev/sdk-js/issues"
14
+ },
15
+ "homepage": "https://github.com/epilot-dev/sdk-js/tree/main/clients/email-setting-client#readme",
16
+ "keywords": [
17
+ "epilot",
18
+ "sdk",
19
+ "email-settings"
20
+ ],
7
21
  "scripts": {
8
22
  "test": "jest",
9
23
  "typescript": "tsc",
10
24
  "bundle-definition": "webpack",
11
- "openapi": "openapi read --json ../lambda/ApiHandlerFunction/openapi.yml > src/openapi.json",
12
- "typegen": "echo '/* eslint-disable */' > src/openapi.d.ts && typegen ../lambda/ApiHandlerFunction/openapi.yml >> src/openapi.d.ts",
13
- "build": "npm run openapi && npm run typegen && npm run typescript && npm run bundle-definition",
14
- "eslint": "../node_modules/.bin/eslint -c ../.eslintrc.yml",
15
- "prepublishOnly": "npm run build"
25
+ "openapi": "../../scripts/update-openapi.sh https://docs.api.epilot.io/email-settings.yaml",
26
+ "typegen": "echo '/* eslint-disable */' > src/openapi.d.ts && typegen ./src/openapi.json >> src/openapi.d.ts",
27
+ "build": "tsc && npm run bundle-definition",
28
+ "build:watch": "npm run build && tsc -w",
29
+ "prepublishOnly": "npm run typegen && npm run build",
30
+ "lint": "../../node_modules/eslint/bin/eslint.js src"
16
31
  },
17
32
  "files": [
18
33
  "*.js",
@@ -25,38 +40,33 @@
25
40
  "!src",
26
41
  "!*.config.js"
27
42
  ],
28
- "repository": {
29
- "type": "git",
30
- "url": "https://github.com/epilot-dev/sdk-js",
31
- "directory": "clients/email-settings-client"
32
- },
33
- "keywords": [],
34
43
  "author": "epilot GmbH",
35
44
  "license": "UNLICENSED",
36
45
  "peerDependencies": {
37
- "axios": "^0.21.4"
46
+ "axios": "^0.25.0"
38
47
  },
39
48
  "dependencies": {
49
+ "@dazn/lambda-powertools-correlation-ids": "^1.28.1",
40
50
  "buffer": "^6.0.3",
41
51
  "https-browserify": "^1.0.0",
42
- "openapi-client-axios": "^4.4.9",
52
+ "openapi-client-axios": "^6.0.0",
43
53
  "stream-http": "^3.1.1",
44
54
  "url": "^0.11.0",
45
55
  "util": "^0.12.3"
46
56
  },
47
57
  "devDependencies": {
48
58
  "@types/jest": "^26.0.20",
49
- "axios": "^0.21.1",
59
+ "axios": "^0.25.0",
50
60
  "copy-webpack-plugin": "^7.0.0",
51
61
  "jest": "^26.6.3",
52
62
  "json-loader": "^0.5.7",
53
- "openapi-client-axios-typegen": "^4.4.9",
54
- "openapicmd": "^1.8.2",
55
- "ts-jest": "^26.5.6",
56
- "ts-loader": "^8.3.0",
57
- "ts-node": "^9.1.1",
58
- "typescript": "^4.5.4",
59
- "webpack": "^5.18.0",
63
+ "openapi-client-axios-typegen": "^6.0.0",
64
+ "openapicmd": "^1.6.2",
65
+ "ts-jest": "^26.5.0",
66
+ "ts-loader": "^8.0.14",
67
+ "ts-node": "^10.9.1",
68
+ "typescript": "^4.1.3",
69
+ "webpack": "~5.18.0",
60
70
  "webpack-cli": "^4.4.0"
61
71
  }
62
72
  }
package/CHANGELOG.md DELETED
@@ -1,5 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
-
5
- ### [0.1.1](https://github.com/epilot-dev/sdk-js/compare/v1.0.0...v0.1.1) (2022-03-09)