@ever-works/everworks-playbooks-plugin 1.0.9 → 1.0.13

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/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- // ../../../node_modules/.pnpm/@ever-co+connect-contracts@1.0.0-rc.7/node_modules/@ever-co/connect-contracts/dist/index.js
5
+ // ../../../node_modules/.pnpm/@ever-co+connect-contracts@1.0.0-rc.8/node_modules/@ever-co/connect-contracts/dist/index.js
6
6
  var PROBLEM_CODES = [
7
7
  "validation_failed",
8
8
  "not_found",
@@ -16,6 +16,10 @@ var PROBLEM_CODES = [
16
16
  "not_connection_owner",
17
17
  "integration_disabled",
18
18
  "integration_revoked",
19
+ "subject_unknown",
20
+ "link_not_found",
21
+ "oidc_client_exists",
22
+ "redirect_uri_invalid",
19
23
  "denied_by_policy",
20
24
  "integration_not_available",
21
25
  "entitlement_required",
@@ -44,6 +48,8 @@ var PROBLEM_CODES = [
44
48
  "illegal_transition",
45
49
  "already_exists",
46
50
  "already_completed",
51
+ "legal_basis_required",
52
+ "receipt_final",
47
53
  "billing_active",
48
54
  "sso_required",
49
55
  "reauth_required",
@@ -110,6 +116,9 @@ var RECORD_VISIBILITIES = ["private", "team", "organization"];
110
116
  new Set(RECORD_VISIBILITIES);
111
117
  var RECORD_LIST_VIEWS = ["mine", "shared", "organization"];
112
118
  new Set(RECORD_LIST_VIEWS);
119
+ new Set(
120
+ "a abbr address applet area article aside audio b base bdi bdo big blockquote body br button canvas caption center cite code col colgroup data datalist dd del details dfn dialog dir div dl dt em embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe image img input ins kbd label legend li link main map mark marquee math menu meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script search section select slot small source span strike strong style sub summary sup svg table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr xmp".split(" ")
121
+ );
113
122
  var VERSION = "1.0.0";
114
123
  var GTM_SKILLS = [
115
124
  // ── research ────────────────────────────────────────────────────────
@@ -1871,9 +1880,16 @@ function playbookSearchFields(entry) {
1871
1880
  extra: entry.stepTitles
1872
1881
  };
1873
1882
  }
1874
- var HTML_TAG_PATTERN = /<[^>]*>/g;
1883
+ var HTML_TAG_PATTERN = /<[^<>]*>/g;
1875
1884
  function sanitizePlaybookText(value, max) {
1876
- return value.replace(HTML_TAG_PATTERN, "").trim().slice(0, max);
1885
+ let current = value;
1886
+ let previous;
1887
+ let passes = 0;
1888
+ do {
1889
+ previous = current;
1890
+ current = current.replace(HTML_TAG_PATTERN, "");
1891
+ } while (current !== previous && ++passes < 32);
1892
+ return current.replace(/(?<!<)<+(?=[a-z/!?])/gi, "").trim().slice(0, max);
1877
1893
  }
1878
1894
  function acceptPlaybookEntry(value) {
1879
1895
  if (!isRecord7(value)) return { entry: null, violation: "entry must be an object" };
@@ -1887,54 +1903,54 @@ function acceptPlaybookEntry(value) {
1887
1903
  return violation ? { entry: null, violation } : { entry: sanitized, violation: null };
1888
1904
  }
1889
1905
  function sanitizePlaybookEntry(entry) {
1890
- const text = (value, max = PLAYBOOK_TEXT_LIMITS.shortText) => sanitizePlaybookText(value ?? "", max);
1891
- const optionalText = (value) => value === void 0 ? void 0 : text(value);
1906
+ const text2 = (value, max = PLAYBOOK_TEXT_LIMITS.shortText) => sanitizePlaybookText(value ?? "", max);
1907
+ const optionalText = (value) => value === void 0 ? void 0 : text2(value);
1892
1908
  const trigger = {
1893
1909
  kind: entry.trigger.kind,
1894
- description: text(entry.trigger.description)
1910
+ description: text2(entry.trigger.description)
1895
1911
  };
1896
- if (entry.trigger.cadence !== void 0) Object.assign(trigger, { cadence: text(entry.trigger.cadence, 64) });
1912
+ if (entry.trigger.cadence !== void 0) Object.assign(trigger, { cadence: text2(entry.trigger.cadence, 64) });
1897
1913
  if (entry.trigger.defaultLocalTime !== void 0) {
1898
- Object.assign(trigger, { defaultLocalTime: text(entry.trigger.defaultLocalTime, 5) });
1914
+ Object.assign(trigger, { defaultLocalTime: text2(entry.trigger.defaultLocalTime, 5) });
1899
1915
  }
1900
1916
  return {
1901
1917
  ...entry,
1902
- title: text(entry.title, PLAYBOOK_TEXT_LIMITS.title),
1903
- outcome: text(entry.outcome, PLAYBOOK_TEXT_LIMITS.outcome),
1904
- summary: text(entry.summary, PLAYBOOK_TEXT_LIMITS.summary),
1905
- icon: text(entry.icon, 32),
1918
+ title: text2(entry.title, PLAYBOOK_TEXT_LIMITS.title),
1919
+ outcome: text2(entry.outcome, PLAYBOOK_TEXT_LIMITS.outcome),
1920
+ summary: text2(entry.summary, PLAYBOOK_TEXT_LIMITS.summary),
1921
+ icon: text2(entry.icon, 32),
1906
1922
  trigger,
1907
1923
  steps: entry.steps.map((step) => ({
1908
1924
  ...step,
1909
- title: text(step.title, PLAYBOOK_TEXT_LIMITS.stepTitle),
1910
- produces: text(step.produces, PLAYBOOK_TEXT_LIMITS.stepProduces)
1925
+ title: text2(step.title, PLAYBOOK_TEXT_LIMITS.stepTitle),
1926
+ produces: text2(step.produces, PLAYBOOK_TEXT_LIMITS.stepProduces)
1911
1927
  })),
1912
1928
  connections: entry.connections.map((need) => {
1913
1929
  const sanitized = {
1914
- capability: text(need.capability, 64),
1930
+ capability: text2(need.capability, 64),
1915
1931
  required: need.required,
1916
- reason: text(need.reason, PLAYBOOK_TEXT_LIMITS.reason)
1932
+ reason: text2(need.reason, PLAYBOOK_TEXT_LIMITS.reason)
1917
1933
  };
1918
1934
  const degraded = optionalText(need.degradedWithout);
1919
1935
  return degraded === void 0 ? sanitized : { ...sanitized, degradedWithout: degraded };
1920
1936
  }),
1921
1937
  artefacts: entry.artefacts.map((artefact) => ({
1922
1938
  kind: artefact.kind,
1923
- title: text(artefact.title),
1924
- where: text(artefact.where)
1939
+ title: text2(artefact.title),
1940
+ where: text2(artefact.where)
1925
1941
  })),
1926
1942
  escalations: entry.escalations.map((point) => ({
1927
- when: text(point.when),
1943
+ when: text2(point.when),
1928
1944
  becomes: point.becomes,
1929
1945
  carriesRecommendation: point.carriesRecommendation
1930
1946
  })),
1931
- tags: entry.tags.map((tag) => text(tag, 40)).filter((tag) => tag.length > 0),
1947
+ tags: entry.tags.map((tag) => text2(tag, 40)).filter((tag) => tag.length > 0),
1932
1948
  provision: {
1933
1949
  ...entry.provision,
1934
- agentName: text(entry.provision.agentName),
1950
+ agentName: text2(entry.provision.agentName),
1935
1951
  taskTemplate: {
1936
- name: text(entry.provision.taskTemplate.name, PLAYBOOK_TEXT_LIMITS.title),
1937
- slug: text(entry.provision.taskTemplate.slug, 64)
1952
+ name: text2(entry.provision.taskTemplate.name, PLAYBOOK_TEXT_LIMITS.title),
1953
+ slug: text2(entry.provision.taskTemplate.slug, 64)
1938
1954
  }
1939
1955
  }
1940
1956
  };
@@ -2160,6 +2176,9 @@ var DOMAIN_EVENT_CATALOG = [
2160
2176
  { type: "inbox.item.answered", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
2161
2177
  { type: "inbox.item.state_changed", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
2162
2178
  { type: "inbox.item.deleted", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
2179
+ // Integration inbox push: an integration's PATCH of its own item, and the member's
2180
+ // answer to an integration item (stored on the item; no run is started).
2181
+ { type: "inbox.item.updated", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
2163
2182
  { type: "kb.document.created", domain: "kb", aggregateType: "kb_document", phase: "P3" },
2164
2183
  { type: "kb.document.updated", domain: "kb", aggregateType: "kb_document", phase: "P3" },
2165
2184
  { type: "kb.document.moved", domain: "kb", aggregateType: "kb_document", phase: "P3" },
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // ../../../node_modules/.pnpm/@ever-co+connect-contracts@1.0.0-rc.7/node_modules/@ever-co/connect-contracts/dist/index.js
1
+ // ../../../node_modules/.pnpm/@ever-co+connect-contracts@1.0.0-rc.8/node_modules/@ever-co/connect-contracts/dist/index.js
2
2
  var PROBLEM_CODES = [
3
3
  "validation_failed",
4
4
  "not_found",
@@ -12,6 +12,10 @@ var PROBLEM_CODES = [
12
12
  "not_connection_owner",
13
13
  "integration_disabled",
14
14
  "integration_revoked",
15
+ "subject_unknown",
16
+ "link_not_found",
17
+ "oidc_client_exists",
18
+ "redirect_uri_invalid",
15
19
  "denied_by_policy",
16
20
  "integration_not_available",
17
21
  "entitlement_required",
@@ -40,6 +44,8 @@ var PROBLEM_CODES = [
40
44
  "illegal_transition",
41
45
  "already_exists",
42
46
  "already_completed",
47
+ "legal_basis_required",
48
+ "receipt_final",
43
49
  "billing_active",
44
50
  "sso_required",
45
51
  "reauth_required",
@@ -106,6 +112,9 @@ var RECORD_VISIBILITIES = ["private", "team", "organization"];
106
112
  new Set(RECORD_VISIBILITIES);
107
113
  var RECORD_LIST_VIEWS = ["mine", "shared", "organization"];
108
114
  new Set(RECORD_LIST_VIEWS);
115
+ new Set(
116
+ "a abbr address applet area article aside audio b base bdi bdo big blockquote body br button canvas caption center cite code col colgroup data datalist dd del details dfn dialog dir div dl dt em embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe image img input ins kbd label legend li link main map mark marquee math menu meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script search section select slot small source span strike strong style sub summary sup svg table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr xmp".split(" ")
117
+ );
109
118
  var VERSION = "1.0.0";
110
119
  var GTM_SKILLS = [
111
120
  // ── research ────────────────────────────────────────────────────────
@@ -1867,9 +1876,16 @@ function playbookSearchFields(entry) {
1867
1876
  extra: entry.stepTitles
1868
1877
  };
1869
1878
  }
1870
- var HTML_TAG_PATTERN = /<[^>]*>/g;
1879
+ var HTML_TAG_PATTERN = /<[^<>]*>/g;
1871
1880
  function sanitizePlaybookText(value, max) {
1872
- return value.replace(HTML_TAG_PATTERN, "").trim().slice(0, max);
1881
+ let current = value;
1882
+ let previous;
1883
+ let passes = 0;
1884
+ do {
1885
+ previous = current;
1886
+ current = current.replace(HTML_TAG_PATTERN, "");
1887
+ } while (current !== previous && ++passes < 32);
1888
+ return current.replace(/(?<!<)<+(?=[a-z/!?])/gi, "").trim().slice(0, max);
1873
1889
  }
1874
1890
  function acceptPlaybookEntry(value) {
1875
1891
  if (!isRecord7(value)) return { entry: null, violation: "entry must be an object" };
@@ -1883,54 +1899,54 @@ function acceptPlaybookEntry(value) {
1883
1899
  return violation ? { entry: null, violation } : { entry: sanitized, violation: null };
1884
1900
  }
1885
1901
  function sanitizePlaybookEntry(entry) {
1886
- const text = (value, max = PLAYBOOK_TEXT_LIMITS.shortText) => sanitizePlaybookText(value ?? "", max);
1887
- const optionalText = (value) => value === void 0 ? void 0 : text(value);
1902
+ const text2 = (value, max = PLAYBOOK_TEXT_LIMITS.shortText) => sanitizePlaybookText(value ?? "", max);
1903
+ const optionalText = (value) => value === void 0 ? void 0 : text2(value);
1888
1904
  const trigger = {
1889
1905
  kind: entry.trigger.kind,
1890
- description: text(entry.trigger.description)
1906
+ description: text2(entry.trigger.description)
1891
1907
  };
1892
- if (entry.trigger.cadence !== void 0) Object.assign(trigger, { cadence: text(entry.trigger.cadence, 64) });
1908
+ if (entry.trigger.cadence !== void 0) Object.assign(trigger, { cadence: text2(entry.trigger.cadence, 64) });
1893
1909
  if (entry.trigger.defaultLocalTime !== void 0) {
1894
- Object.assign(trigger, { defaultLocalTime: text(entry.trigger.defaultLocalTime, 5) });
1910
+ Object.assign(trigger, { defaultLocalTime: text2(entry.trigger.defaultLocalTime, 5) });
1895
1911
  }
1896
1912
  return {
1897
1913
  ...entry,
1898
- title: text(entry.title, PLAYBOOK_TEXT_LIMITS.title),
1899
- outcome: text(entry.outcome, PLAYBOOK_TEXT_LIMITS.outcome),
1900
- summary: text(entry.summary, PLAYBOOK_TEXT_LIMITS.summary),
1901
- icon: text(entry.icon, 32),
1914
+ title: text2(entry.title, PLAYBOOK_TEXT_LIMITS.title),
1915
+ outcome: text2(entry.outcome, PLAYBOOK_TEXT_LIMITS.outcome),
1916
+ summary: text2(entry.summary, PLAYBOOK_TEXT_LIMITS.summary),
1917
+ icon: text2(entry.icon, 32),
1902
1918
  trigger,
1903
1919
  steps: entry.steps.map((step) => ({
1904
1920
  ...step,
1905
- title: text(step.title, PLAYBOOK_TEXT_LIMITS.stepTitle),
1906
- produces: text(step.produces, PLAYBOOK_TEXT_LIMITS.stepProduces)
1921
+ title: text2(step.title, PLAYBOOK_TEXT_LIMITS.stepTitle),
1922
+ produces: text2(step.produces, PLAYBOOK_TEXT_LIMITS.stepProduces)
1907
1923
  })),
1908
1924
  connections: entry.connections.map((need) => {
1909
1925
  const sanitized = {
1910
- capability: text(need.capability, 64),
1926
+ capability: text2(need.capability, 64),
1911
1927
  required: need.required,
1912
- reason: text(need.reason, PLAYBOOK_TEXT_LIMITS.reason)
1928
+ reason: text2(need.reason, PLAYBOOK_TEXT_LIMITS.reason)
1913
1929
  };
1914
1930
  const degraded = optionalText(need.degradedWithout);
1915
1931
  return degraded === void 0 ? sanitized : { ...sanitized, degradedWithout: degraded };
1916
1932
  }),
1917
1933
  artefacts: entry.artefacts.map((artefact) => ({
1918
1934
  kind: artefact.kind,
1919
- title: text(artefact.title),
1920
- where: text(artefact.where)
1935
+ title: text2(artefact.title),
1936
+ where: text2(artefact.where)
1921
1937
  })),
1922
1938
  escalations: entry.escalations.map((point) => ({
1923
- when: text(point.when),
1939
+ when: text2(point.when),
1924
1940
  becomes: point.becomes,
1925
1941
  carriesRecommendation: point.carriesRecommendation
1926
1942
  })),
1927
- tags: entry.tags.map((tag) => text(tag, 40)).filter((tag) => tag.length > 0),
1943
+ tags: entry.tags.map((tag) => text2(tag, 40)).filter((tag) => tag.length > 0),
1928
1944
  provision: {
1929
1945
  ...entry.provision,
1930
- agentName: text(entry.provision.agentName),
1946
+ agentName: text2(entry.provision.agentName),
1931
1947
  taskTemplate: {
1932
- name: text(entry.provision.taskTemplate.name, PLAYBOOK_TEXT_LIMITS.title),
1933
- slug: text(entry.provision.taskTemplate.slug, 64)
1948
+ name: text2(entry.provision.taskTemplate.name, PLAYBOOK_TEXT_LIMITS.title),
1949
+ slug: text2(entry.provision.taskTemplate.slug, 64)
1934
1950
  }
1935
1951
  }
1936
1952
  };
@@ -2156,6 +2172,9 @@ var DOMAIN_EVENT_CATALOG = [
2156
2172
  { type: "inbox.item.answered", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
2157
2173
  { type: "inbox.item.state_changed", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
2158
2174
  { type: "inbox.item.deleted", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
2175
+ // Integration inbox push: an integration's PATCH of its own item, and the member's
2176
+ // answer to an integration item (stored on the item; no run is started).
2177
+ { type: "inbox.item.updated", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
2159
2178
  { type: "kb.document.created", domain: "kb", aggregateType: "kb_document", phase: "P3" },
2160
2179
  { type: "kb.document.updated", domain: "kb", aggregateType: "kb_document", phase: "P3" },
2161
2180
  { type: "kb.document.moved", domain: "kb", aggregateType: "kb_document", phase: "P3" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ever-works/everworks-playbooks-plugin",
3
- "version": "1.0.9",
3
+ "version": "1.0.13",
4
4
  "description": "Ever Works Playbooks — first-party playbook-provider plugin supplying the built-in Playbook catalogue: packaged outcomes with their trigger, steps, required capabilities, artefacts and escalation points.",
5
5
  "author": {
6
6
  "name": "Ever Co. LTD",
@@ -33,8 +33,8 @@
33
33
  "test:coverage": "vitest run --coverage"
34
34
  },
35
35
  "dependencies": {
36
- "@ever-works/contracts": "^1.0.16",
37
- "@ever-works/plugin": "^1.2.12"
36
+ "@ever-works/contracts": "^1.1.1",
37
+ "@ever-works/plugin": "^1.2.28"
38
38
  },
39
39
  "devDependencies": {
40
40
  "tsup": "^8.3.0",
@@ -59,16 +59,16 @@
59
59
  },
60
60
  "repository": {
61
61
  "type": "git",
62
- "url": "git+https://github.com/ever-works/ever-works.git",
62
+ "url": "git+https://github.com/ever-co/ever-works.git",
63
63
  "directory": "packages/plugins/everworks-playbooks"
64
64
  },
65
- "homepage": "https://github.com/ever-works/ever-works/tree/main/packages/plugins/everworks-playbooks#readme",
65
+ "homepage": "https://github.com/ever-co/ever-works/tree/main/packages/plugins/everworks-playbooks#readme",
66
66
  "bugs": {
67
- "url": "https://github.com/ever-works/ever-works/issues"
67
+ "url": "https://github.com/ever-co/ever-works/issues"
68
68
  },
69
69
  "everworksRelease": {
70
- "contentHash": "sha256:849dafa14aa23dca8a4a23f889bae5fd553dfce146ff6ddbcddcd2aac3d25dcd",
71
- "commit": "4b0b642a5bf671c9b0480d49307c2c4442730f28",
72
- "source": "https://github.com/ever-works/ever-works/tree/4b0b642a5bf671c9b0480d49307c2c4442730f28/packages/plugins/everworks-playbooks"
70
+ "contentHash": "sha256:519941e2376fff2217049f3f6a0eeb6c9668dc90452b74f80b51b280d6c83874",
71
+ "commit": "2288ff7e91562b0f079c365348ba08ab3a16f1dd",
72
+ "source": "https://github.com/ever-co/ever-works/tree/2288ff7e91562b0f079c365348ba08ab3a16f1dd/packages/plugins/everworks-playbooks"
73
73
  }
74
74
  }