Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for GCP regions #103

Merged
merged 4 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022-2023 Contentstack
Copyright (c) 2022-2024 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ For more information, please refer to our [App SDK API Reference](https://github

You can extend or customize the functionality of Contentstack CMS with Marketplace apps. To simplify and speed up the building process, boilerplates describe repetitive elements in a project. This boilerplate will help you build custom applications for your organization or stack.

Download the [boilerplate](https://assets.contentstack.io/v3/assets/blt23180bf2502c7444/blt2bccdd28a2d44d1b/62fcb522da3c526fe6314886/app-boilerplate.zip?disposition=download).
Download the [boilerplate](https://github.com/contentstack/marketplace-app-boilerplate/archive/refs/heads/master.zip).

## UI Locations and Examples

Expand Down
4 changes: 4 additions & 0 deletions __test__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ describe("formatAppRegion", () => {
expect(formatAppRegion("AZURE_EU")).toBe(Region.AZURE_EU);
});

it('should return GCP_NA for "GCP_NA"', () => {
expect(formatAppRegion("GCP_NA")).toBe(Region.GCP_NA);
});

it("should return unknown for any invalid region", () => {
expect(formatAppRegion("invalid")).toBe(Region.UNKNOWN);
});
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/app-sdk",
"version": "2.0.0",
"version": "2.0.1",
"types": "dist/src/index.d.ts",
"description": "The Contentstack App SDK allows you to customize your Contentstack applications.",
"main": "dist/index.js",
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,5 @@ export enum Region {
EU = "EU",
AZURE_NA = "AZURE_NA",
AZURE_EU = "AZURE_EU",
GCP_NA = "GCP_NA",
}
14 changes: 3 additions & 11 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,10 @@ export function onError(error: Error) {
}

export function formatAppRegion(region: string): Region {
switch (region) {
case "NA":
return Region.NA;
case "EU":
return Region.EU;
case "AZURE_NA":
return Region.AZURE_NA;
case "AZURE_EU":
return Region.AZURE_EU;
default:
return Region.UNKNOWN;
if (region && Object.values(Region).includes(region as Region)) {
return region as Region;
}
return Region.UNKNOWN;
}

export function getPreferredBodyElement(nodeCollection: HTMLCollection) {
Expand Down
10,552 changes: 5,276 additions & 5,276 deletions yarn.lock

Large diffs are not rendered by default.

Loading