Skip to content

Commit 5d721b8

Browse files
committed
ENG-0000 - Refresh
- Updated typescript to 4.7.x - Updated other packages to corresponding latest version - AlApiClient renamed to AlXHRAdapter for accuracy - AlDefaultClient renamed to AlRootClient (again, for accuracy) - Added @ServiceClient decorator and AlBaseServiceClient, allowing JIT service instantiation and better tree shaking - Updated AIMSClient and SubscriptionsClient to use new client model - Retired some obsolete content Client Architecture: Previously, our API Client architecture has consisted of declaring the client class and then immediately instantiating it as a global variable. In practice, this means that clients a) cannot be tree shaken or bundled outside of the main bundle, and b) every client must by compiled and instantiated before application bootstrap. This is dumb. The new model uses a decorator to identify classes that represent a client. The decorator stores the class's constructor and some default settings for it into a dictionary, which can be used to instantiate the client on-demand. For example: ``` @ServiceClient( { service_name: "gestalt", service_stack: AlLocation.GestaltAPI, version: 1 } ) export class AlsGestalt extends AlBaseServiceClient { ... } ``` Or ``` @ServiceClient( { service_name: "iris", version: 'v3', residencyAware: true } ) export class AlsIris extends AlBaseServiceClient { ... } ``` These classes do not need to be instantiated until they are actually needed. Additional, the properties provided to the ServiceClient decorator as used as defaults, and the AlBaseServiceClient provides convenience `get`, `put`, `post`, `delete`, and `request` methods to facilitate extremely minimal implementations. Nomenclature: Client classes should begin with an "Als" prefix, and be stored with a .service-client.ts extension.
1 parent 8d52f1d commit 5d721b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1948
-2029
lines changed

package-lock.json

Lines changed: 799 additions & 479 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@al/core",
3-
"version": "1.0.190",
3+
"version": "2.0.0",
44
"description": "Node Enterprise Packages for Alert Logic (NEPAL) Core Library",
55
"main": "./dist/index.cjs.js",
66
"types": "./dist/index.d.ts",
@@ -41,28 +41,29 @@
4141
"devDependencies": {
4242
"@types/auth0-js": "^9.14.5",
4343
"@types/chai": "^4.2.21",
44-
"@types/karma": "^5.0.0",
44+
"@types/karma": "^6.3.3",
4545
"@types/mocha": "^7.0.2",
4646
"@types/qs": "^6.9.7",
4747
"@types/sinon": "^9.0.0",
4848
"chai": "^4.2.0",
4949
"copy-webpack-plugin": "^5.0.5",
50-
"karma": "^6.3.4",
51-
"karma-chrome-launcher": "^3.1.0",
50+
"karma": "^6.4.0",
51+
"karma-chrome-launcher": "^3.1.1",
5252
"karma-cli": "^2.0.0",
53-
"karma-mocha": "^1.3.0",
54-
"karma-typescript": "^5.0.2",
53+
"karma-mocha": "^2.0.1",
54+
"karma-typescript": "^5.5.3",
5555
"mocha": "~7.0.1",
5656
"peer-deps-externals-webpack-plugin": "^1.0.4",
5757
"rollup": "^2.56.2",
5858
"rollup-plugin-copy": "^3.3.0",
5959
"rollup-plugin-terser": "^5.3.0",
60-
"rollup-plugin-typescript2": "^0.27.0",
60+
"rollup-plugin-typescript2": "^0.32.1",
6161
"sinon": "^9.0.2",
6262
"ts-loader": "^6.2.2",
63+
"tslib": "^2.4.0",
6364
"tslint": "^5.12.1",
6465
"tslint-config-airbnb": "^5.11.1",
65-
"typescript": "^3.9.10",
66+
"typescript": "^4.7.4",
6667
"webpack": "^4.41.2",
6768
"webpack-bundle-analyzer": "^3.6.0",
6869
"webpack-cli": "^3.2.1",

0 commit comments

Comments
 (0)