seam 0.0.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021-2023 Seam Labs, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,211 +1,202 @@
1
- Seam
2
- =============
1
+ # Seam JavaScript SDK
3
2
 
4
- Seam binds your JS logic to the DOM by adding configuration to the markup.
3
+ [![npm](https://img.shields.io/npm/v/seam.svg)](https://www.npmjs.com/package/seam)
4
+ [![GitHub Actions](https://github.com/seamapi/javascript-next/actions/workflows/check.yml/badge.svg)](https://github.com/seamapi/javascript-next/actions/workflows/check.yml)
5
5
 
6
- Ever wanted to bind your JS logic to the DOM by doing something like this in your HTML?
6
+ JavaScript SDK for the Seam API written in TypeScript.
7
7
 
8
- ```html
9
- <p data-bind="value: name"></p>
10
- <button data-listen="click: doSomething"></button>
11
- ```
8
+ _This repository hosts the next major version of the Seam JavaScript SDK.
9
+ This SDK is available for early preview.
10
+ It will eventually replace the [seamapi](https://github.com/seamapi/javascript/) package._
12
11
 
13
- Seam allows you to do just that. It will create the link between your HTML and your JavaScript logic.
12
+ ## Description
14
13
 
15
- Installation
16
- ============
14
+ [Seam] makes it easy to integrate IoT devices with your applications.
15
+ This is an official SDK for the Seam API.
16
+ Please refer to the official [Seam Docs] to get started.
17
17
 
18
- ```bash
19
- npm install seam
20
- ```
18
+ The SDK is fully tree-shakeable
19
+ and optimized for use in both client and server applications.
21
20
 
22
- How to use
23
- ==========
21
+ The repository does not contain the SDK code.
22
+ Instead, it re-exports from a core set of Seam modules.
24
23
 
25
- Require seam:
24
+ _While this SDK is still in preview,
25
+ please refer to the individual README files in these repositories for
26
+ additional usage documentation not yet available in the primary Seam documentation.
27
+ See [this issue for a draft migration guide](https://github.com/seamapi/javascript-next/issues/1) from the seamapi package._
26
28
 
27
- ```js
28
- var Seam = require("seam");
29
- ```
29
+ - [@seamapi/http]: JavaScript HTTP client for the Seam API written in TypeScript.
30
+ - [@seamapi/webhook]: Webhook SDK for the Seam API written in TypeScript.
31
+ - [@seamapi/types]: TypeScript types for the Seam API.
30
32
 
31
- Let's start with a simple example. We would like to set the value of "name" in the paragraph.
33
+ [Seam]: https://www.seam.co/
34
+ [Seam Docs]: https://docs.seam.co/latest/
35
+ [@seamapi/types]: https://github.com/seamapi/types
36
+ [@seamapi/http]: https://github.com/seamapi/javascript-http
37
+ [@seamapi/webhook]: https://github.com/seamapi/javascript-webhook
32
38
 
33
- ### HTML
39
+ ## Installation
34
40
 
35
- ```html
36
- <p data-bind="value: name"></p>
37
- ```
41
+ Add this as a dependency to your project using [npm] with
38
42
 
39
- ### JavaScript
43
+ ```
44
+ $ npm install seam
45
+ ```
40
46
 
41
- ```js
42
- // The object to display in the DOM
43
- var someone = {
44
- // This is the value that we want to display in the paragraph
45
- name: "John",
46
- type: "Doe"
47
- };
47
+ [npm]: https://www.npmjs.com/
48
48
 
49
- // We start by initializing Seam
50
- var seam = new Seam();
49
+ ### Usage
51
50
 
52
- // Then we add a seam plugin called 'bind'
53
- seam.add("bind", {
51
+ #### Unlock a door
54
52
 
55
- // Which has a method called value
56
- value: function (node, param) {
57
- // That will set the innerText of the dom to "John"
58
- node.innerText = someone[param];
59
- }
60
- });
53
+ ```ts
54
+ import Seam from 'seam'
61
55
 
62
- // Then we tell it where to find the DOM elements to bind
63
- seam.apply(document.querySelector("p"));
56
+ const seam = new Seam()
57
+ const lock = await seam.locks.get({ name: 'Front Door' })
58
+ await seam.locks.unlockDoor({ device_id: lock.device_id })
64
59
  ```
65
60
 
66
- Where data-bind is configured while adding the plugin to seam. We could have used any other allowed name, such as 'listen', 'style', 'css', 'text' or even 'another-plugin_for-seam'.
61
+ #### Parse and validate a webhook
67
62
 
68
- Seam will then execute the method 'value' in the plugin 'bind', passing it two things:
69
- - {HTMLElement} the node to which the data-attribute is applied
70
- - {String} the parameters specified in the data-attribute, after the name of the method (name in our case)
63
+ ```ts
64
+ import { SeamWebhook } from 'seam'
71
65
 
72
- We've just bound some JS logic to a dom element. This seems overkill for such simple task, but it'll make more sense when we'll add more plugins, and especially when they are plugins that we can just reuse.
66
+ const webhook = new SeamWebhook('webhook-secret')
67
+ const data = webhook.verify(payload, headers)
68
+ ```
73
69
 
74
- Let's add more plugins, one for setting data into the DOM, one for listening to DOM events.
70
+ ## Development and Testing
75
71
 
76
- ### HTML
72
+ ### Quickstart
77
73
 
78
- ```html
79
- <section>
80
- <p data-bind="value: name"></p>
81
- <button data-listen="click: doSomething"></button>
82
- </section>
83
74
  ```
75
+ $ git clone https://github.com/seamapi/javascript-next.git
76
+ $ cd javascript-next
77
+ $ nvm install
78
+ $ npm install
79
+ ```
80
+
81
+ Primary development tasks are defined under `scripts` in `package.json`
82
+ and available via `npm run`.
83
+ View them with
84
84
 
85
- In this case, we have two plugins, one called 'bind', and the other one called 'listen'. We can configure Seam to accept more than one plugin by calling the 'addAll' method instead of just 'add':
85
+ ```
86
+ $ npm run
87
+ ```
86
88
 
87
- ```js
88
- // This is some UI with a doSomething method:
89
- var ui = {
90
- doSomething: function () {
91
- // do something
92
- }
93
- }
89
+ ### Source code
94
90
 
95
- seam.addAll({
96
- // This is the plugin that we have seen before
97
- bind: {
98
- value: function (node, param) {
99
- node.innerText = someone[param];
100
- }
101
- },
91
+ The [source code] is hosted on GitHub.
92
+ Clone the project with
102
93
 
103
- // This is the new plugin called listen
104
- listen: {
105
- click: function (node, method) {
106
- node.addEventListener("click", function (event) {
107
- ui[method](event);
108
- }, true);
109
- }
110
- }
111
- });
94
+ ```
95
+ $ git clone git@github.com:seamapi/javascript-next.git
112
96
  ```
113
97
 
114
- We still have the same plugin for adding data to the DOM. We also have added a new plugin called 'listen' that adds an eventListener to the targeted DOM. Whenever the user clicks on this DOM element, it will call the method 'doSomething' on UI.
98
+ [source code]: https://github.com/seamapi/javascript-next
115
99
 
116
- Of course, this example is very limited, as we can't bind a value from an object to something else than innerText, and we can't listen to another event than 'click' as long as we don't create new functions for handling them. Moreover, we can't change the object from which we get the value, nor can we change the object on which to call the method when a click occurs.
100
+ ### Requirements
117
101
 
118
- So let's create some reusable plugins. We pretend that the object that contains the data is a backbone.Model, which triggers events whenever something changes. We could also call a method on a backbone.View when a click occurs.
102
+ You will need [Node.js] with [npm] and a [Node.js debugging] client.
119
103
 
120
- ### HTML
104
+ Be sure that all commands run under the correct Node version, e.g.,
105
+ if using [nvm], install the correct version with
121
106
 
122
- ```html
123
- <section>
124
- <p data-bind="change: name, innerText"></p>
125
- <button data-event="listen: click, alert, name"></p>
126
- </section>
107
+ ```
108
+ $ nvm install
109
+ ```
110
+
111
+ Set the active version for each shell session with
112
+
113
+ ```
114
+ $ nvm use
127
115
  ```
128
116
 
129
- ### JavaScript
117
+ Install the development dependencies with
130
118
 
131
- ```js
132
- // We have a backbone.Model
133
- model.set("name", "Seam");
119
+ ```
120
+ $ npm install
121
+ ```
134
122
 
135
- // We have a backbone.View with an alert method. It alerts the value of "name"
136
- view.alert = function (event, param) {
137
- alert(model.get(param);
138
- };
123
+ [Node.js]: https://nodejs.org/
124
+ [Node.js debugging]: https://nodejs.org/en/docs/guides/debugging-getting-started/
125
+ [npm]: https://www.npmjs.com/
126
+ [nvm]: https://github.com/creationix/nvm
139
127
 
140
- /**
141
- * We create a constructor for a binding plugin
142
- * It takes a model as a parameter so it knows where to get the data
143
- */
144
- function Binding(model) {
128
+ ### Publishing
145
129
 
146
- // This is the change method of our plugin
147
- this.change = function (node, key, attribute) {
130
+ #### Automatic
148
131
 
149
- // We need to set the innerText of the DOM to the current value
150
- node[attribute] = model.get(key);
132
+ New versions are released automatically with [semantic-release]
133
+ as long as commits follow the [Angular Commit Message Conventions].
151
134
 
152
- // Whenever the value changes, we update the dom
153
- model.on("change:" + key, function (newValue) {
154
- node[attribute] = newValue;
155
- });
135
+ [Angular Commit Message Conventions]: https://semantic-release.gitbook.io/semantic-release/#commit-message-format
136
+ [semantic-release]: https://semantic-release.gitbook.io/
156
137
 
157
- };
158
- }
138
+ #### Manual
159
139
 
160
- /**
161
- * Then we create a constructor for an event plugin
162
- * It takes a view as parameter, so it knows where to call the method
163
- */
164
- function Event(view) {
140
+ Publish a new version by triggering a [version workflow_dispatch on GitHub Actions].
141
+ The `version` input will be passed as the first argument to [npm-version].
165
142
 
166
- this.event = function (node, eventName, methodName, param) {
167
- node.addEventListener(eventName, function (event) {
168
- view[methodName](event, param);
169
- });
170
- };
143
+ This may be done on the web or using the [GitHub CLI] with
171
144
 
172
- }
145
+ ```
146
+ $ gh workflow run version.yml --raw-field version=<version>
147
+ ```
173
148
 
174
- // We create our Seam
175
- var seam = new Seam();
149
+ [GitHub CLI]: https://cli.github.com/
150
+ [npm-version]: https://docs.npmjs.com/cli/version
151
+ [version workflow_dispatch on GitHub Actions]: https://github.com/seamapi/javascript-next/actions?query=workflow%3Aversion
176
152
 
177
- // Then we add our plugins
178
- seam.add({
153
+ ## GitHub Actions
179
154
 
180
- // We initialize a new binding plugin with the model we want to listen to
181
- "bind": new Binding(model),
155
+ _GitHub Actions should already be configured: this section is for reference only._
182
156
 
183
- // We initialize a new event plugin with the view we want to call the methods on
184
- "event": new Event(view)
157
+ The following repository secrets must be set on [GitHub Actions]:
185
158
 
186
- });
159
+ - `NPM_TOKEN`: npm token for installing and publishing packages.
160
+ - `GH_TOKEN`: A personal access token for the bot user with
161
+ and `contents:write` permission.
162
+ - `GIT_USER_NAME`: The GitHub bot user's real name.
163
+ - `GIT_USER_EMAIL`: The GitHub bot user's email.
164
+ - `GPG_PRIVATE_KEY`: The GitHub bot user's [GPG private key].
165
+ - `GPG_PASSPHRASE`: The GitHub bot user's GPG passphrase.
187
166
 
188
- // And finally, we apply it to the parent element of the DOM that we want to bind to this logic
189
- seam.apply( document.querySelector("section") );
190
- ```
167
+ [GitHub Actions]: https://github.com/features/actions
168
+ [GPG private key]: https://github.com/marketplace/actions/import-gpg#prerequisites
191
169
 
192
- In this more complete example, we have a Binding plugin that will listen to changes on a backbone.Model to update the DOM. We have created a reusable data-binding plugin that can now be reused to bind as many backbone.Model as we want to our DOM. We have even specified which property of the DOM node we want to update. It could be the className, or even value for form elements!
170
+ ## Contributing
193
171
 
194
- Then we have created an Event listener that will listen to 'click', or any other event we want to listen to, and forward the event to the method of the view that we have initialized the plugin with.
172
+ > If using squash merge, edit and ensure the commit message follows the [Angular Commit Message Conventions] specification.
173
+ > Otherwise, each individual commit must follow the [Angular Commit Message Conventions] specification.
195
174
 
196
- We can also call multiple methods on the same DOM element:
175
+ 1. Create your feature branch (`git checkout -b my-new-feature`).
176
+ 2. Make changes.
177
+ 3. Commit your changes (`git commit -am 'Add some feature'`).
178
+ 4. Push to the branch (`git push origin my-new-feature`).
179
+ 5. Create a new draft pull request.
180
+ 6. Ensure all checks pass.
181
+ 7. Mark your pull request ready for review.
182
+ 8. Wait for the required approval from the code owners.
183
+ 9. Merge when ready.
197
184
 
198
- ```html
199
- <p data-plugin="method1: param1, param2, paramN; method2: param1, param2, paramN"></p>
200
- ```
185
+ [Angular Commit Message Conventions]: https://semantic-release.gitbook.io/semantic-release/#commit-message-format
201
186
 
202
- Or we can call multiple plugins on the same DOM element
187
+ ## License
203
188
 
204
- ```html
205
- <p data-plugin1="method: param1, param2" data-plugin2="method1: param1, param2; method2, param1, param2"></p>
206
- ```
189
+ This npm package is licensed under the MIT license.
207
190
 
208
- LICENSE
209
- =======
191
+ ## Warranty
210
192
 
211
- MIT
193
+ This software is provided by the copyright holders and contributors "as is" and
194
+ any express or implied warranties, including, but not limited to, the implied
195
+ warranties of merchantability and fitness for a particular purpose are
196
+ disclaimed. In no event shall the copyright holder or contributors be liable for
197
+ any direct, indirect, incidental, special, exemplary, or consequential damages
198
+ (including, but not limited to, procurement of substitute goods or services;
199
+ loss of use, data, or profits; or business interruption) however caused and on
200
+ any theory of liability, whether in contract, strict liability, or tort
201
+ (including negligence or otherwise) arising in any way out of the use of this
202
+ software, even if advised of the possibility of such damage.
package/dist/index.cjs ADDED
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var connect = require('@seamapi/http/connect');
6
+ var connect$1 = require('@seamapi/types/connect');
7
+ var webhook = require('@seamapi/webhook');
8
+
9
+
10
+
11
+ Object.defineProperty(exports, "Seam", {
12
+ enumerable: true,
13
+ get: function () { return connect.SeamHttp; }
14
+ });
15
+ Object.defineProperty(exports, "default", {
16
+ enumerable: true,
17
+ get: function () { return connect.SeamHttp; }
18
+ });
19
+ Object.keys(connect).forEach(function (k) {
20
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
21
+ enumerable: true,
22
+ get: function () { return connect[k]; }
23
+ });
24
+ });
25
+ Object.keys(connect$1).forEach(function (k) {
26
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
27
+ enumerable: true,
28
+ get: function () { return connect$1[k]; }
29
+ });
30
+ });
31
+ Object.keys(webhook).forEach(function (k) {
32
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
33
+ enumerable: true,
34
+ get: function () { return webhook[k]; }
35
+ });
36
+ });
37
+ //# sourceMappingURL=out.js.map
38
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAAA,SAAS,YAAY,YAAY;AAEjC,cAAc;AACd,cAAc;AACd,cAAc","sourcesContent":["import { SeamHttp as Seam } from '@seamapi/http/connect'\n\nexport * from '@seamapi/http/connect'\nexport * from '@seamapi/types/connect'\nexport * from '@seamapi/webhook'\nexport { Seam }\nexport { Seam as default }\n"]}
@@ -0,0 +1,4 @@
1
+ export * from '@seamapi/http/connect';
2
+ export { SeamHttp as Seam, SeamHttp as default } from '@seamapi/http/connect';
3
+ export * from '@seamapi/types/connect';
4
+ export * from '@seamapi/webhook';
package/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { SeamHttp as Seam } from '@seamapi/http/connect';
2
+ export * from '@seamapi/http/connect';
3
+ export * from '@seamapi/types/connect';
4
+ export * from '@seamapi/webhook';
5
+ export { Seam };
6
+ export { Seam as default };
package/index.js CHANGED
@@ -1,148 +1,7 @@
1
- /**
2
- * @license seam https://github.com/flams/seam
3
- *
4
- * The MIT License (MIT)
5
- *
6
- * Copyright (c) 2014 Olivier Scherrer <pode.fr@gmail.com>
7
- */
8
- "use strict";
9
-
10
- var toArray = require("to-array"),
11
- simpleLoop = require("simple-loop"),
12
- getNodes = require("get-nodes"),
13
- getDataset = require("get-dataset");
14
-
15
- /**
16
- * Seam makes it easy to attach JS behavior to your HTML/SVG via the data- attribute.
17
- * <div data-plugin="method: param, param, ..."></tag>
18
- *
19
- * JS behaviors are defined in plugins, which are plain JS objects with data and methods.
20
- */
21
- module.exports = function Seam($plugins) {
22
-
23
- /**
24
- * The list of plugins
25
- * @private
26
- */
27
- var _plugins = {},
28
-
29
- /**
30
- * Just a "functionalification" of trim
31
- * for code readability
32
- * @private
33
- */
34
- trim = function trim(string) {
35
- return string.trim();
36
- },
37
-
38
- /**
39
- * Call the plugins methods, passing them the dom node
40
- * A phrase can be :
41
- * <tag data-plugin='method: param, param; method:param...'/>
42
- * the function has to call every method of the plugin
43
- * passing it the node, and the given params
44
- * @private
45
- */
46
- applyPlugin = function applyPlugin(node, phrase, plugin) {
47
- // Split the methods
48
- phrase.split(";")
49
- .forEach(function (couple) {
50
- // Split the result between method and params
51
- var split = couple.split(":"),
52
- // Trim the name
53
- method = split[0].trim(),
54
- // And the params, if any
55
- params = split[1] ? split[1].split(",").map(trim) : [];
56
-
57
- // The first param must be the dom node
58
- params.unshift(node);
59
-
60
- if (_plugins[plugin] && _plugins[plugin][method]) {
61
- // Call the method with the following params for instance :
62
- // [node, "param1", "param2" .. ]
63
- _plugins[plugin][method].apply(_plugins[plugin], params);
64
- }
65
-
66
- });
67
- };
68
-
69
- /**
70
- * Add a plugin
71
- *
72
- * Note that once added, the function adds a "plugins" property to the plugin.
73
- * It's an object that holds a name property, with the registered name of the plugin
74
- * and an apply function, to use on new nodes that the plugin would generate
75
- *
76
- * @param {String} name the name of the data that the plugin should look for
77
- * @param {Object} plugin the plugin that has the functions to execute
78
- * @returns true if plugin successfully added.
79
- */
80
- this.add = function add(name, plugin) {
81
- var propertyName = "plugins";
82
-
83
- if (typeof name == "string" && typeof plugin == "object" && plugin) {
84
- _plugins[name] = plugin;
85
-
86
- plugin[propertyName] = {
87
- name: name,
88
- apply: function apply() {
89
- return this.apply.apply(this, arguments);
90
- }.bind(this)
91
- };
92
- return true;
93
- } else {
94
- return false;
95
- }
96
- };
97
-
98
- /**
99
- * Add multiple plugins at once
100
- * @param {Object} list key is the plugin name and value is the plugin
101
- * @returns true if correct param
102
- */
103
- this.addAll = function addAll(list) {
104
- return simpleLoop(list, function (plugin, name) {
105
- this.add(name, plugin);
106
- }, this);
107
- };
108
-
109
- /**
110
- * Get a previously added plugin
111
- * @param {String} name the name of the plugin
112
- * @returns {Object} the plugin
113
- */
114
- this.get = function get(name) {
115
- return _plugins[name];
116
- };
117
-
118
- /**
119
- * Delete a plugin from the list
120
- * @param {String} name the name of the plugin
121
- * @returns {Boolean} true if success
122
- */
123
- this.del = function del(name) {
124
- return delete _plugins[name];
125
- };
126
-
127
- /**
128
- * Apply the plugins to a NodeList
129
- * @param {HTMLElement|SVGElement} dom the dom nodes on which to apply the plugins
130
- * @returns {Boolean} true if the param is a dom node
131
- */
132
- this.apply = function apply(dom) {
133
- var nodes = getNodes(dom);
134
-
135
- simpleLoop(toArray(nodes), function (node) {
136
- simpleLoop(getDataset(node), function (phrase, plugin) {
137
- applyPlugin(node, phrase, plugin);
138
- });
139
- });
140
-
141
- return dom;
142
- };
143
-
144
- if ($plugins) {
145
- this.addAll($plugins);
146
- }
147
-
148
- };
1
+ import { SeamHttp as Seam } from '@seamapi/http/connect';
2
+ export * from '@seamapi/http/connect';
3
+ export * from '@seamapi/types/connect';
4
+ export * from '@seamapi/webhook';
5
+ export { Seam };
6
+ export { Seam as default };
7
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAExD,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,CAAA;AACf,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,46 +1,83 @@
1
1
  {
2
2
  "name": "seam",
3
- "description": "Seam binds your JS logic to the DOM by adding configuration to the markup.",
4
- "version": "0.0.3",
5
- "homepage": "https://github.com/flams/seam",
6
- "licenses": [
7
- {
8
- "type": "MIT",
9
- "url": "https://raw.github.com/flams/seam/master/LICENSE"
3
+ "version": "0.2.0",
4
+ "description": "JavaScript SDK for the Seam API written in TypeScript.",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "types": "index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./index.d.ts",
12
+ "default": "./index.js"
13
+ },
14
+ "require": {
15
+ "types": "./dist/index.d.cts",
16
+ "default": "./dist/index.cjs"
17
+ }
10
18
  }
11
- ],
12
- "files": [
13
- "LICENSE",
14
- "index.js"
15
- ],
16
- "author": "Olivier Scherrer <pode.fr@gmail.com>",
19
+ },
20
+ "module": "index.js",
21
+ "sideEffects": false,
17
22
  "keywords": [
18
- "html",
19
- "behavior",
20
- "plugin",
21
- "binding",
22
- "template",
23
- "declarative"
23
+ "node"
24
24
  ],
25
- "repository": {
26
- "type": "git",
27
- "url": "git@github.com:flams/seam.git"
28
- },
29
- "bugs": {
30
- "url": "https://github.com/flams/seam/issues"
25
+ "homepage": "https://github.com/seamapi/javascript-next",
26
+ "bugs": "https://github.com/seamapi/javascript-next/issues",
27
+ "repository": "seamapi/javascript-next",
28
+ "license": "MIT",
29
+ "author": {
30
+ "name": "Seam Labs, Inc.",
31
+ "email": "devops@getseam.com"
31
32
  },
33
+ "files": [
34
+ "index.js",
35
+ "index.js.map",
36
+ "index.d.ts",
37
+ "src",
38
+ "dist"
39
+ ],
32
40
  "scripts": {
33
- "test": "jasmine-node test/"
41
+ "build": "npm run build:entrypoints",
42
+ "prebuild": "tsx src/index.ts",
43
+ "postbuild": "node ./index.js",
44
+ "build:entrypoints": "npm run build:ts",
45
+ "postbuild:entrypoints": "tsup",
46
+ "build:ts": "tsc --project tsconfig.build.json",
47
+ "prebuild:ts": "del 'index.*'",
48
+ "postbuild:ts": "tsc-alias --project tsconfig.build.json",
49
+ "typecheck": "tsc",
50
+ "test": "true",
51
+ "pretest": "tsx src/index.ts",
52
+ "lint": "eslint --ignore-path .gitignore .",
53
+ "prelint": "prettier --check --ignore-path .gitignore .",
54
+ "postversion": "git push --follow-tags",
55
+ "format": "eslint --ignore-path .gitignore --fix .",
56
+ "preformat": "prettier --write --ignore-path .gitignore ."
34
57
  },
35
- "main": "index.js",
36
- "devDependencies": {
37
- "jasmine-node": "~1.14.3",
38
- "quick-dom": "0.0.1"
58
+ "engines": {
59
+ "node": ">=18.12.0",
60
+ "npm": ">= 9.0.0"
39
61
  },
40
62
  "dependencies": {
41
- "to-array": "~0.1.4",
42
- "simple-loop": "0.0.2",
43
- "get-nodes": "0.0.1",
44
- "get-dataset": "0.0.1"
63
+ "@seamapi/http": "0.14.0",
64
+ "@seamapi/types": "1.85.0",
65
+ "@seamapi/webhook": "0.1.0",
66
+ "seamapi-types": "1.32.0"
67
+ },
68
+ "devDependencies": {
69
+ "@types/node": "^20.8.10",
70
+ "del-cli": "^5.0.0",
71
+ "eslint": "^8.9.0",
72
+ "eslint-config-prettier": "^9.0.0",
73
+ "eslint-config-standard": "^17.1.0",
74
+ "eslint-config-standard-with-typescript": "^43.0.0",
75
+ "eslint-plugin-simple-import-sort": "^10.0.0",
76
+ "eslint-plugin-unused-imports": "^3.0.0",
77
+ "prettier": "^3.0.0",
78
+ "tsc-alias": "^1.8.2",
79
+ "tsup": "^8.0.1",
80
+ "tsx": "^4.6.2",
81
+ "typescript": "^5.1.0"
45
82
  }
46
83
  }
package/src/index.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { SeamHttp as Seam } from '@seamapi/http/connect'
2
+
3
+ export * from '@seamapi/http/connect'
4
+ export * from '@seamapi/types/connect'
5
+ export * from '@seamapi/webhook'
6
+ export { Seam }
7
+ export { Seam as default }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- /**
2
- * @license seam https://github.com/flams/seam
3
- *
4
- * The MIT License (MIT)
5
- *
6
- * Copyright (c) 2014 Olivier Scherrer <pode.fr@gmail.com>
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
9
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
10
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
11
- * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all copies or substantial
14
- * portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
17
- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20
- * IN THE SOFTWARE.
21
- */