Skip to content
Closed
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
18 changes: 5 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,13 @@ jobs:
timeout-minutes: 5

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cronofy-node
- name: Set up Node.js
uses: actions/setup-node@v4
with:
path: ~/.npm
key: ${{ runner.os }}-js-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-js-${{ env.cache-name }}-
${{ runner.os }}-js-
${{ runner.os }}-
node-version: '24'
cache: 'npm'

- name: CI
run: make ci


37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
workflow_dispatch:
inputs:
git_tag:
description: 'Git tag to publish a release for (eg. v0.0.0)'
required: true

permissions:
id-token: write # Required for OIDC
contents: read

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: '${{ github.event.inputs.git_tag }}'

- uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'

# Required to resolve an issue with publishing provenance
- name: Update npm
run: npm install -g npm@latest

- name: Publish to NPM
run: |
make ci
echo ""
echo "Publishing"
npm publish --no-provenance
# Note: Do NOT set NODE_AUTH_TOKEN!
3 changes: 2 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
nodejs 16.1.0
nodejs 24.14.1
yarn 1.22.22
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ CURRENT_VERSION:=$(shell jq ".version" -r package.json)
all: install

.PHONY: ci
ci: install
npm ci
ci:
yarn install --frozen-lockfile --silent --prefer-offline --no-progress

.PHONY: init
init: install

.PHONY: install
install:
npm install
yarn install

.PHONY: test
test:
npm test
yarn test

.PHONY: check_dependencies
check_dependencies:
Expand Down
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,31 @@ The APIs should be one to one with the all of the current methods in [Cronofy's

#### Usage Example

```node
var Cronofy = require('cronofy');
```javascript
const Cronofy = require('cronofy');

var cronofyClient = new Cronofy({
const cronofyClient = new Cronofy({
client_id: 'armzr1h5NPQST93XTFL9iIULXxfdDlmV',
client_secret: 'aPPwd-ASDFAsdfasdfasdfsadfasdfASDFSADF_asdfasdfasdf',
access_token: 'aLUj9bRInSj1n08pHPAo5ru0OOppDaCO',
refresh_token: '5hdSBZHgjA4xcQAelyAYWDfezZv0-9yP',
data_center: 'de'
});

var options = {
const options = {
code: 'asdkfj213sdf',
redirect_uri: 'https://www.yoursite.com/calendar_redirect_page'
};

cronofyClient.requestAccessToken(options)
.then(function(response){
console.log(response);
});
// Using async/await
const response = await cronofyClient.requestAccessToken(options);
console.log(response);

// Alternatively as a callback
cronofyClient.requestAccessToken(options, function(err, response){
if(err) throw err;
cronofyClient.requestAccessToken(options, (err, response) => {
if (err) throw err;
console.log(response);
})
});
```

### Parameters Note
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"url": "https://github.com/cronofy/cronofy-node/issues"
},
"homepage": "https://github.com/cronofy/cronofy-node#readme",
"engines": {
"node": ">=24.0.0"
},
"dependencies": {
"axios": "1.12.0",
"qs": "^6.10.3"
Expand All @@ -34,8 +37,8 @@
"devDependencies": {
"chai": "^4.3.0",
"lodash": "^4.17.0",
"mocha": "^9.0.0",
"nock": "^13.0.0",
"semistandard": "^11.0.0"
"mocha": "^11.0.0",
"nock": "^14.0.0",
"semistandard": "^17.0.0"
}
}
Loading
Loading