@bettsnation/paperclip-plugin-servicenow 0.1.0 → 0.1.1

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,35 @@
1
+ import { describe, it } from "node:test";
2
+ import assert from "node:assert/strict";
3
+ describe("manifest", () => {
4
+ it("has all required fields", async () => {
5
+ const { default: manifest } = await import("../manifest.js");
6
+ assert.ok(manifest.id, "id is required");
7
+ assert.ok(manifest.apiVersion, "apiVersion is required");
8
+ assert.ok(manifest.version, "version is required");
9
+ assert.ok(manifest.displayName, "displayName is required");
10
+ assert.ok(Array.isArray(manifest.capabilities), "capabilities must be an array");
11
+ assert.ok(manifest.entrypoints, "entrypoints is required");
12
+ assert.ok(manifest.entrypoints.worker, "entrypoints.worker is required");
13
+ });
14
+ it("id follows naming convention", async () => {
15
+ const { default: manifest } = await import("../manifest.js");
16
+ assert.match(manifest.id, /^[a-z0-9]+\.[a-z0-9]+$/, "id should be namespace.name format");
17
+ });
18
+ it("declares webhook endpoints", async () => {
19
+ const { default: manifest } = await import("../manifest.js");
20
+ assert.ok(Array.isArray(manifest.webhooks), "webhooks must be an array");
21
+ assert.ok(manifest.webhooks.length > 0, "must have at least one webhook endpoint");
22
+ assert.ok(manifest.webhooks[0].endpointKey, "webhook must have endpointKey");
23
+ });
24
+ });
25
+ describe("worker", () => {
26
+ it("exports a valid plugin object from definePlugin", async () => {
27
+ // Import only the default export — do not invoke setup() since it requires SDK context
28
+ const { default: plugin } = await import("../worker.js");
29
+ assert.ok(plugin, "default export must be defined");
30
+ assert.equal(typeof plugin.definition.setup, "function", "plugin.definition.setup must be a function");
31
+ assert.equal(typeof plugin.definition.onWebhook, "function", "plugin.definition.onWebhook must be a function");
32
+ assert.equal(typeof plugin.definition.onHealth, "function", "plugin.definition.onHealth must be a function");
33
+ assert.equal(typeof plugin.definition.onShutdown, "function", "plugin.definition.onShutdown must be a function");
34
+ });
35
+ });
package/dist/manifest.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const manifest = {
2
2
  id: "bettsnation.servicenow",
3
3
  apiVersion: 1,
4
- version: "0.1.0",
4
+ version: "0.1.1",
5
5
  displayName: "ServiceNow Integration",
6
6
  description: "Bidirectional ServiceNow incident sync. Receives SN webhooks to create Paperclip issues, auto-updates SN incidents as issues progress.",
7
7
  author: "BettsNation",
package/dist/worker.js CHANGED
@@ -146,7 +146,7 @@ const plugin = definePlugin({
146
146
  title: `[${incident.number}] ${incident.short_description}`,
147
147
  description,
148
148
  status: "todo",
149
- priority: PRIORITY_MAP[incident.priority ?? "3"] ?? "medium",
149
+ priority: (PRIORITY_MAP[incident.priority ?? "3"] ?? "medium"),
150
150
  assigneeAgentId: config.targetAgentId,
151
151
  projectId: config.targetProjectId,
152
152
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bettsnation/paperclip-plugin-servicenow",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "Paperclip plugin for bidirectional ServiceNow incident sync — webhook intake and auto-resolve",
6
6
  "paperclipPlugin": {
@@ -9,7 +9,8 @@
9
9
  },
10
10
  "scripts": {
11
11
  "build": "tsc",
12
- "typecheck": "tsc --noEmit"
12
+ "typecheck": "tsc --noEmit",
13
+ "test": "node --import tsx --test src/__tests__/*.test.ts"
13
14
  },
14
15
  "peerDependencies": {
15
16
  "@paperclipai/plugin-sdk": ">=0.1.0"
@@ -17,6 +18,7 @@
17
18
  "devDependencies": {
18
19
  "@paperclipai/plugin-sdk": "^2026.403.0",
19
20
  "@types/node": "^22.0.0",
21
+ "tsx": "^4.19.0",
20
22
  "typescript": "^5.7.0"
21
23
  },
22
24
  "files": [