Skip to content

Commit 6a8d1dc

Browse files
authored
v0.1.0 (#3)
1 parent 72034c4 commit 6a8d1dc

File tree

125 files changed

+3656
-587
lines changed

Some content is hidden

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

125 files changed

+3656
-587
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
*.log
66
**\node_modules
77
**\wwwroot\lib\**
8-
dist
8+
dist
9+
.env

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Dime Software
3+
Copyright (c) 2024 Dime Software
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+27-33
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<div align="center">
2-
<img src="https://cdn.dimescheduler.com/dime-scheduler/Dime.Scheduler-Black.svg" height="100px" />
2+
<img src="https://cdn.dimescheduler.com/dime-scheduler/v2/logo.svg" height="100px" />
33
</div>
44

5+
<br />
6+
57
<div align="center">
6-
<img src="assets/app.webp" height="300px" />
8+
<img src="https://cdn.dimescheduler.com/dime-scheduler/screenshots/ds-screen-8.png" height="300px" />
79
</div>
810

911
<p align="center">
@@ -13,57 +15,54 @@
1315
</p>
1416

1517
<div align="center">
16-
<img src="https://github.com/dime-scheduler/sdk-js/actions/workflows/ci.yml/badge.svg?branch=master" />
1718
<img src="https://img.shields.io/npm/v/dimescheduler?style=flat-square" />
18-
<img src="https://img.shields.io/npm/l/dimescheduler" />
19+
<img src="https://img.shields.io/npm/l/dimescheduler?style=flat-square&color=brightgreen" />
20+
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square" />
1921
</div>
2022

2123

2224
<h1 align="center"> Dime.Scheduler SDK for JavaScript</h1>
2325

24-
Supercharge your business by powering up Microsoft Dynamics 365 Business Central with a centralized resource and project planning solution 📅. Dime.Scheduler, with its powerful features and flexible design, has a proven track record in various industries and is trusted by dozens of resellers and thousands of people all over the world 🚀.
26+
Supercharge your business by powering up Microsoft Dynamics 365 Business Central with a centralized resource and project planning solution 📅. Dime.Scheduler, with its powerful features and flexible design, has a proven track record in constious industries and is trusted by dozens of resellers and thousands of people all over the world 🚀.
2527

26-
🧑‍🏫 Want to see the SDK in action? Check out an example [here](https://stackblitz.com/edit/ds-category?file=index.js).
28+
Check out the [📚 docs »](https://docs.dimescheduler.com) for more info.
2729

2830
## Installation
2931

3032
Use whichever package manager you prefer:
3133

3234
```bash
35+
# with npm
3336
npm install dimescheduler
37+
38+
# with yarn
3439
yarn add dimescheduler
40+
41+
# with bun
42+
bun i dimescheduler
3543
```
3644

3745
## Example
3846

39-
🧑‍🏫 Want to see the SDK in action? Check out an example [here](https://stackblitz.com/edit/ds-category?file=index.js).
40-
41-
```javascript
42-
import { DimeSchedulerClient, FormsAuthenticator, Import } from 'dimescheduler';
47+
The sample below shows how to insert or update a category, which is a visual indicator that is used to render the background colors of appointments on the planning board. All you need to do is:
48+
- Import the Dime.Scheduler client class
49+
- Import and instantiate the model classes
50+
- Instantiate the client class with the API key, and optionally, the environment
51+
- Invoke the import method to enter this object into Dime.Scheduler
4352

44-
var uri = 'https://my-dimescheduler.uri';
45-
var user = '[email protected]';
46-
var pw = "mypassword";
4753

48-
var authn = new FormsAuthenticator(uri, user, pw);
49-
var client = new DimeSchedulerClient(uri, authn);
54+
```javascript
55+
import DimeSchedulerClient from 'dimescheduler';
56+
import { Category } from "dimescheduler/models";
5057

51-
var category = new Import.Category();
52-
category.name = "New category";
53-
category.color = '#000000';
58+
const category = new Category();
59+
category.color = '#' + (Math.random() * 0xFFFFFF << 0).toString(16);
60+
category.name = "My category";
5461

55-
client.import
56-
.processAsync(category)
57-
.then((res) => {
58-
console.log(res.data.Success? 'Success!' : "Oh oh, something didn't quite go well.";);
59-
})
60-
.catch((err) => console.log('Something went wrong: ' + err.toString()));
62+
const dimeSchedulerClient = new DimeSchedulerClient(apiKey);
63+
const response = await dimeSchedulerClient.import(category);
6164
```
6265

63-
## Read more
64-
65-
Check out the [📚 docs »](https://sdk.dimescheduler.com) for more info.
66-
6766
## Contributing
6867

6968
![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)
@@ -74,9 +73,4 @@ Pull requests are welcome. Please check out the contribution and code of conduct
7473

7574
![MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg?style=flat-square)
7675

77-
Copyright © Dime CVBA - All rights reserved.
78-
79-
Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential.
80-
81-
Written by Hendrik Bulens [email protected], March 2022.
8276

package.json

+17-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
{
22
"name": "dimescheduler",
33
"description": "The Dime.Scheduler SDK",
4-
"version": "0.0.1-alpha.17",
4+
"version": "0.1.0",
55
"main": "./dist/index.ts",
66
"types": "./dist/index.d.ts",
77
"module": "./dist/esm/index.js",
88
"type": "module",
9+
"exports": {
10+
".": {
11+
"types": "./dist/index.d.ts",
12+
"default": "./dist/index.js"
13+
},
14+
"./models": {
15+
"types": "./dist/lib/models/index.d.ts",
16+
"default": "./dist/lib/models/index.js"
17+
}
18+
},
919
"files": [
1020
"dist",
1121
"LICENSE",
1222
"README.md"
1323
],
14-
"repository": "https://github.com/dime-scheduler/sdk-nodejs",
24+
"repository": "https://github.com/dime-scheduler/sdk-js",
1525
"author": "Hendrik Bulens",
1626
"license": "MIT",
1727
"keywords": [
@@ -22,14 +32,14 @@
2232
"power-apps"
2333
],
2434
"scripts": {
25-
"build": "yarn build:esm && yarn build:cjs",
26-
"build:esm": "tsc",
27-
"build:cjs": "tsc --module commonjs --outDir dist/cjs",
35+
"build": "tsc",
2836
"clean": "tsc --build --clean",
37+
"pub": "yarn clean && yarn build && yarn publish",
2938
"test": "ts-mocha test/**/*.ts --timeout 10000"
3039
},
3140
"dependencies": {
32-
"axios": "^0.27.2"
41+
"axios": "^0.27.2",
42+
"reflect-metadata": "^0.2.2"
3343
},
3444
"devDependencies": {
3545
"@tsconfig/recommended": "^1.0.1",
@@ -41,4 +51,4 @@
4151
"ts-node": "^10.9.1",
4252
"typescript": "^4.7.4"
4353
}
44-
}
54+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true },
4+
extends: [
5+
'eslint:recommended',
6+
'plugin:@typescript-eslint/recommended',
7+
'plugin:react-hooks/recommended',
8+
],
9+
ignorePatterns: ['dist', '.eslintrc.cjs'],
10+
parser: '@typescript-eslint/parser',
11+
plugins: ['react-refresh'],
12+
rules: {
13+
'react-refresh/only-export-components': [
14+
'warn',
15+
{ allowConstantExport: true },
16+
],
17+
},
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Dime.Scheduler SDK for JavaScript sample: Update location
2+
3+
## Getting started
4+
5+
To run the project, run the following commands:
6+
7+
```cmd
8+
bun install
9+
bun dev
10+
```
11+
12+
Create an `.env` file with the Mapbox and Dime.Scheduler API keys:
13+
14+
```
15+
VITE_MAPBOX_KEY=
16+
VITE_DS_API_KEY=
17+
```
18+
19+
20+
The terminal will prompt the URI where you can access the web app.
21+
22+
## About
23+
24+
Most of the interesting code is in the `App.tsx` file. In the `updateLocation` method, the SDK is invoked.
25+
26+
```javascript
27+
const updateLocation = async (resourceNo: string, latitude: number, longitude: number) => {
28+
const location = new Models.ResourceGpsTracking();
29+
location.resourceNo = resourceNo;
30+
location.latitude = latitude;
31+
location.longitude = longitude;
32+
33+
const client = new DimeSchedulerClient(apiKey);
34+
await client.import(location);
35+
}
36+
```
37+
38+
## Application in action
39+
40+
![](./assets/location.gif)
Loading
134 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!doctype html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<link rel="icon" type="image/svg+xml" href="https://cdn.dimescheduler.com/dime-scheduler/v2/shape.svg" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>Dime.Scheduler location tracker</title>
9+
</head>
10+
11+
<body>
12+
<div id="root"></div>
13+
<script type="module" src="/src/main.tsx"></script>
14+
</body>
15+
16+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "ds-sample-locations",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"dimescheduler": "^0.0.1-alpha.35",
14+
"mapbox-gl": "^3.3.0",
15+
"react": "^18.2.0",
16+
"react-dom": "^18.2.0",
17+
"react-hook-form": "^7.51.3"
18+
},
19+
"devDependencies": {
20+
"@types/react": "^18.2.66",
21+
"@types/react-dom": "^18.2.22",
22+
"@typescript-eslint/eslint-plugin": "^7.2.0",
23+
"@typescript-eslint/parser": "^7.2.0",
24+
"@vitejs/plugin-react": "^4.2.1",
25+
"eslint": "^8.57.0",
26+
"eslint-plugin-react-hooks": "^4.6.0",
27+
"eslint-plugin-react-refresh": "^0.4.6",
28+
"tailwindcss": "^3.4.3",
29+
"typescript": "^5.2.2",
30+
"vite": "^5.2.0"
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#root {
2+
max-width: 1280px;
3+
margin: 0 auto;
4+
padding: 2rem;
5+
text-align: center;
6+
}
7+
8+
.logo {
9+
height: 6em;
10+
padding: 1.5em;
11+
will-change: filter;
12+
transition: filter 300ms;
13+
}
14+
.logo:hover {
15+
filter: drop-shadow(0 0 2em #646cffaa);
16+
}
17+
.logo.react:hover {
18+
filter: drop-shadow(0 0 2em #61dafbaa);
19+
}
20+
21+
@keyframes logo-spin {
22+
from {
23+
transform: rotate(0deg);
24+
}
25+
to {
26+
transform: rotate(360deg);
27+
}
28+
}
29+
30+
@media (prefers-reduced-motion: no-preference) {
31+
a:nth-of-type(2) .logo {
32+
animation: logo-spin infinite 20s linear;
33+
}
34+
}
35+
36+
.card {
37+
padding: 2em;
38+
}
39+
40+
.read-the-docs {
41+
color: #888;
42+
}

0 commit comments

Comments
 (0)