Skip to content

Commit

Permalink
Merge pull request #87 from contentstack/staging
Browse files Browse the repository at this point in the history
Merge staging to main
  • Loading branch information
aman19K authored Jan 29, 2024
2 parents 1d0ca05 + a45e7e3 commit 2c6a40c
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 14 deletions.
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) 2023 Contentstack
Copyright (c) 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 @@ -80,5 +80,5 @@ EXAMPLES
$ csdx cm:stacks:validate-regex -a <management_token_alias> -c -g -f <path/to/the/directory>
```

_See code: [src/commands/cm/stacks/validate-regex.ts](https://github.com/contentstack/cli-cm-regex-validate/blob/v1.1.12/src/commands/cm/stacks/validate-regex.ts)_
_See code: [src/commands/cm/stacks/validate-regex.ts](https://github.com/contentstack/cli-cm-regex-validate/blob/v1.2.0/src/commands/cm/stacks/validate-regex.ts)_
<!-- commandsstop -->
28 changes: 21 additions & 7 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-regex-validate",
"description": "Validate Fields with Regex Property of Content Type and Global Field in a Stack",
"version": "1.1.12",
"version": "1.2.0",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli-cm-regex-validate/issues",
"devDependencies": {
Expand Down Expand Up @@ -63,7 +63,7 @@
"dependencies": {
"@contentstack/cli-command": "^1.2.16",
"@contentstack/cli-utilities": "^1.5.7",
"@contentstack/management": "^1.10.2",
"@contentstack/management": "^1.13.0",
"cli-table3": "^0.6.0",
"cli-ux": "^6.0.9",
"inquirer": "^8.2.4",
Expand Down
15 changes: 12 additions & 3 deletions src/utils/connect-stack.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cli } from "cli-ux";
import * as contentstackSdk from "@contentstack/management";

import { configHandler } from '@contentstack/cli-utilities';
import processStack from "./process-stack";
const regexMessages = require("../../messages/index.json").validateRegex;

Expand All @@ -14,9 +14,18 @@ export default async function connectStack(
cli.action.start(regexMessages.cliAction.connectStackStart, "", {
stdout: true,
});
const client = contentstackSdk.client({

const option: contentstackSdk.ContentstackConfig = {
host: host,
});
}

// Adding early access headers
const earlyAccessHeaders = configHandler.get(`earlyAccessHeaders`);
if (earlyAccessHeaders && Object.keys(earlyAccessHeaders).length > 0) {
option.early_access = Object.values(earlyAccessHeaders);
}

const client = contentstackSdk.client(option);
const stackInstance = client.stack({
api_key: tokenDetails.apiKey,
management_token: tokenDetails.token,
Expand Down

0 comments on commit 2c6a40c

Please sign in to comment.