inngest 0.4.0 โ†’ 0.4.2

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/README.md CHANGED
@@ -1,39 +1,100 @@
1
- # inngest
1
+ <div align="center">
2
+ <br/>
3
+ <a href="https://www.inngest.com"><img src="https://user-images.githubusercontent.com/306177/191580717-1f563f4c-31e3-4aa0-848c-5ddc97808a9a.png" width="250" /></a>
4
+ <br/>
5
+ <br/>
6
+ <p>
7
+ Serverless event-driven queues, background jobs, and scheduled jobs for Typescript.<br />
8
+ Works with any framework and platform.
9
+ </p>
10
+ Read the <a href="https://www.inngest.com/docs">documentation</a> and get started in minutes.
11
+ <br/>
12
+ <p>
2
13
 
3
- [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)
4
- [![npm version](https://img.shields.io/npm/v/inngest)](https://www.npmjs.com/package/inngest)
5
- [![Discord](https://img.shields.io/discord/842170679536517141?label=discord)](https://discord.gg/EuesV2ZSnX)
6
- [![Twitter Follow](https://img.shields.io/twitter/follow/inngest?style=social)](https://twitter.com/inngest)
14
+ <a href="http://www.typescriptlang.org/"><img src="https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg" /></a>
15
+ <a href="https://www.npmjs.com/package/inngest"><img src="https://img.shields.io/npm/v/inngest" /></a>
16
+ <a href="https://discord.gg/EuesV2ZSnX"><img src="https://img.shields.io/discord/842170679536517141?label=discord" /></a>
17
+ <a href="https://twitter.com/inngest"><img src="https://img.shields.io/twitter/follow/inngest?style=social" /></a>
7
18
 
8
- Build, test, and deploy code that runs in response to events or on a schedule right in your own codebase.
19
+ </p>
20
+ </div>
9
21
 
10
- ๐Ÿ‘‹ _**Have a question or feature request? [Join our Discord](https://www.inngest.com/discord)!**_
22
+ <hr />
11
23
 
12
- ```
13
- npm install inngest
14
- ```
24
+ Build, test, and deploy code that runs in response to events or on a schedule right in your own codebase.<br />
25
+ ๐Ÿ‘‹ _Have a question or feature request? [Join our Discord](https://www.inngest.com/discord)!_
15
26
 
16
- ```ts
17
- // Send events
18
- import { Inngest } from "inngest";
19
- const inngest = new Inngest({ name: "My App" });
27
+ <br />
20
28
 
21
- inngest.send("app/user.created", { data: { id: 123 } });
29
+ <p align="center">
30
+ <a href="#getting-started">Getting started</a> ยท
31
+ <a href="#features">Features</a> ยท
32
+ <a href="#contributing">Contributing</a> ยท
33
+ <a href="https://www.inngest.com/docs">Documentation</a>
34
+ </p>
35
+
36
+ <br />
37
+
38
+ ## Getting started
39
+
40
+ <br />
41
+
42
+ Install Inngest:
43
+
44
+ ```bash
45
+ npm install inngest # or yarn install inngest
22
46
  ```
23
47
 
48
+ <br />
49
+
50
+ **Writing functions**: Write serverless functions and background jobs right in your own code:
51
+
24
52
  ```ts
25
- // Listen to events
53
+
26
54
  import { createFunction } from "inngest";
27
55
 
28
56
  export default createFunction(
29
57
  "Send welcome email",
30
- "app/user.created",
58
+ "app/user.created", // Subscribe to the `app/user.created` event.
31
59
  ({ event }) => {
32
60
  sendEmailTo(event.data.id, "Welcome!");
33
61
  }
34
62
  );
35
63
  ```
36
64
 
65
+ Functions listen to events which can be triggered by API calls, webhooks, integrations, or external services. When a matching event is received, the serverless function runs automatically, with built in retries.
66
+
67
+ <br />
68
+
69
+ **Triggering functions by events:**
70
+
71
+
72
+ ```ts
73
+ // Send events
74
+ import { Inngest } from "inngest";
75
+ const inngest = new Inngest({ name: "My App" });
76
+
77
+ // This will run the function above automatically, in the background
78
+ inngest.send("app/user.created", { data: { id: 123 } });
79
+ ```
80
+
81
+ Events trigger any number of functions automatically, in parallel, in the background. Inngest also stores a history of all events for observability, testing, and replay.
82
+
83
+
84
+ <br />
85
+
86
+ ## Features
87
+
88
+ - **Fully serverless:** Run background jobs, scheduled functions, and build event-driven systems without any servers, state, or setup
89
+ - **Deploy anywhere**: works with NextJS, Netlify, Vercel, Redwood, Express, Cloudflare, and Lambda
90
+ - **Use your existing code:** write functions within your current project, zero learning required
91
+ - **A complete platform**: complex functionality built in, such as **event replay**, **canary deploys**, **version management** and **git integration**
92
+ - **Fully typed**: Event schemas, versioning, and governance out of the box
93
+ - **Observable**: A full UI for managing and inspecting your functions
94
+ - **Any language:** Use our CLI to write functions using any language
95
+
96
+ <br />
97
+
37
98
  ## Contributing
38
99
 
39
100
  Clone the repository, then:
@@ -75,7 +75,7 @@ class InngestFunction {
75
75
  triggers: [__classPrivateFieldGet(this, _InngestFunction_trigger, "f")],
76
76
  steps: Object.keys(__classPrivateFieldGet(this, _InngestFunction_steps, "f")).reduce((acc, stepId) => {
77
77
  const url = new URL(baseUrl.href);
78
- url.searchParams.set(consts_1.fnIdParam, __classPrivateFieldGet(this, _InngestFunction_opts, "f").name);
78
+ url.searchParams.set(consts_1.fnIdParam, this.id);
79
79
  url.searchParams.set(consts_1.stepIdParam, stepId);
80
80
  return Object.assign(Object.assign({}, acc), { [stepId]: {
81
81
  id: stepId,
@@ -1 +1 @@
1
- {"version":3,"file":"InngestFunction.js","sourceRoot":"","sources":["../../src/components/InngestFunction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8CAA2D;AAS3D;;;;;;;;GAQG;AACH,MAAa,eAAe;IAK1B;;;;;;OAMG;IACH;IACE;;OAEG;IACH,IAAqB,EACrB,OAAsC,EACtC,KAAY;;QAjBd,wCAAgC;QAChC,2CAAiD;QACjD,yCAAuB;QAiBrB,uBAAA,IAAI,yBAAS,IAAI,MAAA,CAAC;QAClB,uBAAA,IAAI,4BAAY,OAAO,MAAA,CAAC;QACxB,uBAAA,IAAI,0BAAU,KAAK,IAAI,EAAE,MAAA,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,EAAE;QACX,IAAI,CAAC,uBAAA,IAAI,6BAAM,CAAC,EAAE,EAAE;YAClB,uBAAA,IAAI,6BAAM,CAAC,EAAE,GAAG,uBAAA,IAAI,+DAAY,MAAhB,IAAI,CAAc,CAAC;SACpC;QAED,OAAO,uBAA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IAC3B,CAAC;CAgBF;AA7GD,0CA6GC;;IAVG,MAAM,IAAI,GAAG,GAAG,CAAC;IAEjB,OAAO,uBAAA,IAAI,6BAAM,CAAC,IAAI;SACnB,WAAW,EAAE;SACb,UAAU,CAAC,cAAc,EAAE,IAAI,CAAC;SAChC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC;SACvB,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"InngestFunction.js","sourceRoot":"","sources":["../../src/components/InngestFunction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8CAA2D;AAS3D;;;;;;;;GAQG;AACH,MAAa,eAAe;IAK1B;;;;;;OAMG;IACH;IACE;;OAEG;IACH,IAAqB,EACrB,OAAsC,EACtC,KAAY;;QAjBd,wCAAgC;QAChC,2CAAiD;QACjD,yCAAuB;QAiBrB,uBAAA,IAAI,yBAAS,IAAI,MAAA,CAAC;QAClB,uBAAA,IAAI,4BAAY,OAAO,MAAA,CAAC;QACxB,uBAAA,IAAI,0BAAU,KAAK,IAAI,EAAE,MAAA,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,EAAE;QACX,IAAI,CAAC,uBAAA,IAAI,6BAAM,CAAC,EAAE,EAAE;YAClB,uBAAA,IAAI,6BAAM,CAAC,EAAE,GAAG,uBAAA,IAAI,+DAAY,MAAhB,IAAI,CAAc,CAAC;SACpC;QAED,OAAO,uBAAA,IAAI,6BAAM,CAAC,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,uBAAA,IAAI,6BAAM,CAAC,IAAI,CAAC;IACzB,CAAC;IAED;;OAEG;IACK,SAAS;IACf;;;;OAIG;IACH,OAAY;QAEZ,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,E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,IAAI,CAAC,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inngest",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Official SDK for Inngest.com",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -17,18 +17,18 @@
17
17
  "scripts": {
18
18
  "prebuild": "genversion --semi --double --es6 ./src/version.ts",
19
19
  "build": "yarn run clean && tsc",
20
- "postbuild": "cp ../package.json ../LICENSE.md ../README.md .",
21
20
  "test": "jest --passWithNoTests",
22
21
  "clean": "rm -rf ./dist",
23
- "prepare": "yarn run build",
24
- "postversion": "cp package.json LICENSE.md README.md dist",
22
+ "postversion": "yarn run build:copy",
25
23
  "release": "yarn run np",
26
24
  "api-extractor": "api-extractor",
27
25
  "dev": "concurrently --names Build,Lint --prefix-colors \"green.inverse,magenta.inverse\" --handle-input \"yarn run dev:build\" \"yarn run dev:lint\"",
28
26
  "dev:build": "nodemon -w src -e ts -i version.ts --delay 300ms -x 'yarn run build && yarn run build:check --local'",
29
27
  "dev:lint": "nodemon -w src -e ts -i version.ts --delay 300ms -x 'eslint .'",
30
28
  "build:api": "api-extractor run --local --verbose",
31
- "build:check": "api-extractor run --verbose"
29
+ "build:check": "api-extractor run --verbose",
30
+ "build:copy": "cp package.json LICENSE.md README.md dist",
31
+ "prelink": "yarn run build:copy"
32
32
  },
33
33
  "homepage": "https://github.com/inngest/inngest-js#readme",
34
34
  "repository": {
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const version = "0.4.0-beta.10";
1
+ export declare const version = "0.4.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,UAAU,CAAC"}
package/version.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
4
  // Generated by genversion.
5
- exports.version = "0.4.0-beta.10";
5
+ exports.version = "0.4.1";
6
6
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AACd,QAAA,OAAO,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AACd,QAAA,OAAO,GAAG,OAAO,CAAC"}
package/src/version.ts DELETED
@@ -1,2 +0,0 @@
1
- // Generated by genversion.
2
- export const version = "0.4.0";