@greatwait/contracts 0.2.2 → 0.3.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.
Files changed (79) hide show
  1. package/dist/attempt-search.d.ts +235 -0
  2. package/dist/attempt-search.js +98 -0
  3. package/dist/billing.d.ts +4 -4
  4. package/dist/bulk-operations.d.ts +1832 -0
  5. package/dist/bulk-operations.js +610 -0
  6. package/dist/configuration-bounds.d.ts +12 -0
  7. package/dist/configuration-bounds.js +12 -0
  8. package/dist/configuration.d.ts +71 -0
  9. package/dist/configuration.js +204 -0
  10. package/dist/data-export.d.ts +3 -3
  11. package/dist/effective-limits.d.ts +4 -4
  12. package/dist/execution-selection.d.ts +48 -0
  13. package/dist/execution-selection.js +21 -0
  14. package/dist/http-request.d.ts +1 -1
  15. package/dist/identifiers.d.ts +2 -0
  16. package/dist/identifiers.js +2 -0
  17. package/dist/identity.d.ts +3 -3
  18. package/dist/index.d.ts +5 -0
  19. package/dist/index.js +5 -0
  20. package/dist/occurrence-states.d.ts +14 -0
  21. package/dist/occurrence-states.js +13 -0
  22. package/dist/operations.d.ts +573 -89
  23. package/dist/operations.js +67 -0
  24. package/dist/protocol.d.ts +19 -5
  25. package/dist/protocol.js +14 -7
  26. package/dist/schedule-selection.d.ts +28 -0
  27. package/dist/schedule-selection.js +48 -0
  28. package/dist/scheduling-records.d.ts +20 -20
  29. package/dist/scheduling.d.ts +64 -63
  30. package/dist/scheduling.js +10 -37
  31. package/dist/test-sink.d.ts +6 -6
  32. package/dist/usage.d.ts +3 -3
  33. package/generated/v1/examples/attempts.search.response.json +42 -0
  34. package/generated/v1/examples/bulk.cancel.request.json +3 -0
  35. package/generated/v1/examples/bulk.cancel.response.json +59 -0
  36. package/generated/v1/examples/bulk.confirm.request.json +5 -0
  37. package/generated/v1/examples/bulk.confirm.response.json +59 -0
  38. package/generated/v1/examples/bulk.items.response.json +3 -0
  39. package/generated/v1/examples/bulk.list.response.json +63 -0
  40. package/generated/v1/examples/bulk.pause.request.json +3 -0
  41. package/generated/v1/examples/bulk.pause.response.json +59 -0
  42. package/generated/v1/examples/bulk.preview.request.json +12 -0
  43. package/generated/v1/examples/bulk.preview.response.json +59 -0
  44. package/generated/v1/examples/bulk.read.response.json +59 -0
  45. package/generated/v1/examples/bulk.resume.request.json +3 -0
  46. package/generated/v1/examples/bulk.resume.response.json +59 -0
  47. package/generated/v1/manifest.json +243 -1
  48. package/generated/v1/openapi.json +21569 -2418
  49. package/generated/v1/policy-matrix.json +63 -0
  50. package/generated/v1/schemas/attempts.search.query.json +96 -0
  51. package/generated/v1/schemas/attempts.search.response.json +271 -0
  52. package/generated/v1/schemas/bulk.cancel.request.json +13 -0
  53. package/generated/v1/schemas/bulk.cancel.response.json +1717 -0
  54. package/generated/v1/schemas/bulk.confirm.request-headers.json +13 -0
  55. package/generated/v1/schemas/bulk.confirm.request.json +19 -0
  56. package/generated/v1/schemas/bulk.confirm.response.json +1717 -0
  57. package/generated/v1/schemas/bulk.items.query.json +29 -0
  58. package/generated/v1/schemas/bulk.items.response.json +194 -0
  59. package/generated/v1/schemas/bulk.list.query.json +32 -0
  60. package/generated/v1/schemas/bulk.list.response.json +1789 -0
  61. package/generated/v1/schemas/bulk.pause.request.json +13 -0
  62. package/generated/v1/schemas/bulk.pause.response.json +1717 -0
  63. package/generated/v1/schemas/bulk.preview.request.json +1218 -0
  64. package/generated/v1/schemas/bulk.preview.response.json +1717 -0
  65. package/generated/v1/schemas/bulk.read.response.json +1717 -0
  66. package/generated/v1/schemas/bulk.resume.request.json +13 -0
  67. package/generated/v1/schemas/bulk.resume.response.json +1717 -0
  68. package/generated/v1/schemas/executions.list.query.json +33 -12
  69. package/generated/v1/schemas/schedules.list.query.json +32 -3
  70. package/generated/v1/snippets/attempts.search.json +6 -0
  71. package/generated/v1/snippets/bulk.cancel.json +6 -0
  72. package/generated/v1/snippets/bulk.confirm.json +6 -0
  73. package/generated/v1/snippets/bulk.items.json +6 -0
  74. package/generated/v1/snippets/bulk.list.json +6 -0
  75. package/generated/v1/snippets/bulk.pause.json +6 -0
  76. package/generated/v1/snippets/bulk.preview.json +6 -0
  77. package/generated/v1/snippets/bulk.read.json +6 -0
  78. package/generated/v1/snippets/bulk.resume.json +6 -0
  79. package/package.json +1 -1
@@ -12,10 +12,6 @@
12
12
  "minimum": 1,
13
13
  "maximum": 100
14
14
  },
15
- "endpoint": {
16
- "type": "string",
17
- "pattern": "^ep_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
18
- },
19
15
  "external_identifier": {
20
16
  "type": "string",
21
17
  "minLength": 1,
@@ -28,10 +24,43 @@
28
24
  "maxLength": 64,
29
25
  "description": "An exact, case-sensitive tag of at most 64 UTF-8 bytes."
30
26
  },
27
+ "status": {
28
+ "type": "string",
29
+ "enum": ["active", "paused", "cancelled", "completed"]
30
+ },
31
+ "recurrence": {
32
+ "type": "string",
33
+ "enum": ["at", "every", "cron"]
34
+ },
35
+ "endpoint": {
36
+ "anyOf": [
37
+ {
38
+ "type": "string",
39
+ "pattern": "^ep_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
40
+ },
41
+ {
42
+ "type": "string",
43
+ "const": "none"
44
+ }
45
+ ]
46
+ },
47
+ "text": {
48
+ "description": "Case-insensitive literal substring of schedule name, endpoint address or schedule identifier.",
49
+ "type": "string",
50
+ "maxLength": 256
51
+ },
52
+ "schedule": {
53
+ "type": "string",
54
+ "pattern": "^sch_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
55
+ },
31
56
  "from": {
32
57
  "type": "string",
33
58
  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
34
59
  },
60
+ "to": {
61
+ "type": "string",
62
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
63
+ },
35
64
  "outcome": {
36
65
  "type": "string",
37
66
  "enum": [
@@ -45,14 +74,6 @@
45
74
  "cancelled",
46
75
  "skipped_stale"
47
76
  ]
48
- },
49
- "schedule": {
50
- "type": "string",
51
- "pattern": "^sch_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
52
- },
53
- "to": {
54
- "type": "string",
55
- "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
56
77
  }
57
78
  }
58
79
  }
@@ -24,13 +24,42 @@
24
24
  "maxLength": 64,
25
25
  "description": "An exact, case-sensitive tag of at most 64 UTF-8 bytes."
26
26
  },
27
- "dueBefore": {
27
+ "status": {
28
28
  "type": "string",
29
- "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
29
+ "enum": ["active", "paused", "cancelled", "completed"]
30
+ },
31
+ "recurrence": {
32
+ "type": "string",
33
+ "enum": ["at", "every", "cron"]
30
34
  },
31
35
  "endpoint": {
36
+ "anyOf": [
37
+ {
38
+ "type": "string",
39
+ "pattern": "^ep_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
40
+ },
41
+ {
42
+ "type": "string",
43
+ "const": "none"
44
+ }
45
+ ]
46
+ },
47
+ "text": {
48
+ "description": "Case-insensitive literal substring of schedule name, endpoint address or schedule identifier.",
49
+ "type": "string",
50
+ "maxLength": 256
51
+ },
52
+ "schedule": {
32
53
  "type": "string",
33
- "pattern": "^ep_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
54
+ "pattern": "^sch_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
55
+ },
56
+ "dueAfter": {
57
+ "type": "string",
58
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
59
+ },
60
+ "dueBefore": {
61
+ "type": "string",
62
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
34
63
  },
35
64
  "order": {
36
65
  "default": "created",
@@ -0,0 +1,6 @@
1
+ {
2
+ "curl": "curl -sS -X GET \"$GREATWAIT_API_URL/v1/attempts\" \\\n --variable %GREATWAIT_API_KEY \\\n --expand-header \"Authorization: Bearer {{GREATWAIT_API_KEY}}\" \\\n --get \\\n --data-urlencode \"startedBefore=$GREATWAIT_STARTEDBEFORE\" \\\n --data-urlencode \"startedFrom=$GREATWAIT_STARTEDFROM\"",
3
+ "environments": ["test", "live"],
4
+ "javascript": "import { createGreatwaitClient } from \"@greatwait/api-client\";\n\nconst greatwait = createGreatwaitClient({\n baseUrl: process.env.GREATWAIT_API_URL,\n credential: process.env.GREATWAIT_API_KEY,\n fetch,\n});\n\nconst result = await greatwait.request(\"attempts_search\", { \"startedBefore\": process.env.GREATWAIT_STARTEDBEFORE, \"startedFrom\": process.env.GREATWAIT_STARTEDFROM });",
5
+ "mcp": "// Any MCP client, against $GREATWAIT_API_URL/mcp.\n{\n \"arguments\": {\n \"startedBefore\": \"$STARTEDBEFORE\",\n \"startedFrom\": \"$STARTEDFROM\"\n },\n \"name\": \"attempts_search\"\n}"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "curl": "curl -sS -X POST \"$GREATWAIT_API_URL/v1/bulk/jobs/$GREATWAIT_JOBID/cancel\" \\\n --variable %GREATWAIT_API_KEY \\\n --expand-header \"Authorization: Bearer {{GREATWAIT_API_KEY}}\" \\\n -H 'Content-Type: application/json' \\\n --data-binary '{\"expectedVersion\":1}'",
3
+ "environments": ["test", "live"],
4
+ "javascript": "import { createGreatwaitClient } from \"@greatwait/api-client\";\n\nconst greatwait = createGreatwaitClient({\n baseUrl: process.env.GREATWAIT_API_URL,\n credential: process.env.GREATWAIT_API_KEY,\n fetch,\n});\n\nconst jobId = process.env.GREATWAIT_JOBID;\n\nconst body = {\n \"expectedVersion\": 1\n};\n\nconst result = await greatwait.request(\"bulk_cancel\", jobId, body);",
5
+ "mcp": "// Any MCP client, against $GREATWAIT_API_URL/mcp.\n{\n \"arguments\": {\n \"expectedVersion\": 1,\n \"jobId\": \"$JOBID\"\n },\n \"name\": \"bulk_cancel\"\n}"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "curl": "curl -sS -X POST \"$GREATWAIT_API_URL/v1/bulk/jobs/$GREATWAIT_JOBID/confirm\" \\\n --variable %GREATWAIT_API_KEY \\\n --expand-header \"Authorization: Bearer {{GREATWAIT_API_KEY}}\" \\\n -H 'Content-Type: application/json' \\\n -H 'Idempotency-Key: $GREATWAIT_IDEMPOTENCY_KEY' \\\n --data-binary '{\"intentDigest\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"confirmed\":true,\"acknowledgeDuplicateEffects\":false}'",
3
+ "environments": ["test", "live"],
4
+ "javascript": "import { createGreatwaitClient } from \"@greatwait/api-client\";\n\nconst greatwait = createGreatwaitClient({\n baseUrl: process.env.GREATWAIT_API_URL,\n credential: process.env.GREATWAIT_API_KEY,\n fetch,\n});\n\nconst jobId = process.env.GREATWAIT_JOBID;\n\nconst body = {\n \"intentDigest\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n \"confirmed\": true,\n \"acknowledgeDuplicateEffects\": false\n};\n\nconst result = await greatwait.request(\"bulk_confirm\", jobId, body, { \"Idempotency-Key\": process.env.GREATWAIT_IDEMPOTENCY_KEY });",
5
+ "mcp": "// Any MCP client, against $GREATWAIT_API_URL/mcp.\n{\n \"arguments\": {\n \"Idempotency-Key\": \"$IDEMPOTENCY_KEY\",\n \"acknowledgeDuplicateEffects\": false,\n \"confirmed\": true,\n \"intentDigest\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n \"jobId\": \"$JOBID\"\n },\n \"name\": \"bulk_confirm\"\n}"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "curl": "curl -sS -X GET \"$GREATWAIT_API_URL/v1/bulk/jobs/$GREATWAIT_JOBID/items\" \\\n --variable %GREATWAIT_API_KEY \\\n --expand-header \"Authorization: Bearer {{GREATWAIT_API_KEY}}\"",
3
+ "environments": ["test", "live"],
4
+ "javascript": "import { createGreatwaitClient } from \"@greatwait/api-client\";\n\nconst greatwait = createGreatwaitClient({\n baseUrl: process.env.GREATWAIT_API_URL,\n credential: process.env.GREATWAIT_API_KEY,\n fetch,\n});\n\nconst jobId = process.env.GREATWAIT_JOBID;\n\nconst result = await greatwait.request(\"bulk_items\", jobId);",
5
+ "mcp": "// Any MCP client, against $GREATWAIT_API_URL/mcp.\n{\n \"arguments\": {\n \"jobId\": \"$JOBID\"\n },\n \"name\": \"bulk_items\"\n}"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "curl": "curl -sS -X GET \"$GREATWAIT_API_URL/v1/bulk/jobs\" \\\n --variable %GREATWAIT_API_KEY \\\n --expand-header \"Authorization: Bearer {{GREATWAIT_API_KEY}}\"",
3
+ "environments": ["test", "live"],
4
+ "javascript": "import { createGreatwaitClient } from \"@greatwait/api-client\";\n\nconst greatwait = createGreatwaitClient({\n baseUrl: process.env.GREATWAIT_API_URL,\n credential: process.env.GREATWAIT_API_KEY,\n fetch,\n});\n\nconst result = await greatwait.request(\"bulk_list\");",
5
+ "mcp": "// Any MCP client, against $GREATWAIT_API_URL/mcp.\n{\n \"arguments\": {},\n \"name\": \"bulk_list\"\n}"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "curl": "curl -sS -X POST \"$GREATWAIT_API_URL/v1/bulk/jobs/$GREATWAIT_JOBID/pause\" \\\n --variable %GREATWAIT_API_KEY \\\n --expand-header \"Authorization: Bearer {{GREATWAIT_API_KEY}}\" \\\n -H 'Content-Type: application/json' \\\n --data-binary '{\"expectedVersion\":1}'",
3
+ "environments": ["test", "live"],
4
+ "javascript": "import { createGreatwaitClient } from \"@greatwait/api-client\";\n\nconst greatwait = createGreatwaitClient({\n baseUrl: process.env.GREATWAIT_API_URL,\n credential: process.env.GREATWAIT_API_KEY,\n fetch,\n});\n\nconst jobId = process.env.GREATWAIT_JOBID;\n\nconst body = {\n \"expectedVersion\": 1\n};\n\nconst result = await greatwait.request(\"bulk_pause\", jobId, body);",
5
+ "mcp": "// Any MCP client, against $GREATWAIT_API_URL/mcp.\n{\n \"arguments\": {\n \"expectedVersion\": 1,\n \"jobId\": \"$JOBID\"\n },\n \"name\": \"bulk_pause\"\n}"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "curl": "curl -sS -X POST \"$GREATWAIT_API_URL/v1/bulk/jobs\" \\\n --variable %GREATWAIT_API_KEY \\\n --expand-header \"Authorization: Bearer {{GREATWAIT_API_KEY}}\" \\\n -H 'Content-Type: application/json' \\\n --data-binary '{\"operation\":\"pause\",\"target\":\"schedules\",\"selection\":{\"kind\":\"all_matching\",\"resource\":\"schedules\",\"filter\":{\"tag\":\"reminders\"}},\"parameters\":{}}'",
3
+ "environments": ["test", "live"],
4
+ "javascript": "import { createGreatwaitClient } from \"@greatwait/api-client\";\n\nconst greatwait = createGreatwaitClient({\n baseUrl: process.env.GREATWAIT_API_URL,\n credential: process.env.GREATWAIT_API_KEY,\n fetch,\n});\n\nconst body = {\n \"operation\": \"pause\",\n \"target\": \"schedules\",\n \"selection\": {\n \"kind\": \"all_matching\",\n \"resource\": \"schedules\",\n \"filter\": {\n \"tag\": \"reminders\"\n }\n },\n \"parameters\": {}\n};\n\nconst result = await greatwait.request(\"bulk_preview\", body);",
5
+ "mcp": "// Any MCP client, against $GREATWAIT_API_URL/mcp.\n{\n \"arguments\": {\n \"operation\": \"pause\",\n \"parameters\": {},\n \"selection\": {\n \"kind\": \"all_matching\",\n \"resource\": \"schedules\",\n \"filter\": {\n \"tag\": \"reminders\"\n }\n },\n \"target\": \"schedules\"\n },\n \"name\": \"bulk_preview\"\n}"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "curl": "curl -sS -X GET \"$GREATWAIT_API_URL/v1/bulk/jobs/$GREATWAIT_JOBID\" \\\n --variable %GREATWAIT_API_KEY \\\n --expand-header \"Authorization: Bearer {{GREATWAIT_API_KEY}}\"",
3
+ "environments": ["test", "live"],
4
+ "javascript": "import { createGreatwaitClient } from \"@greatwait/api-client\";\n\nconst greatwait = createGreatwaitClient({\n baseUrl: process.env.GREATWAIT_API_URL,\n credential: process.env.GREATWAIT_API_KEY,\n fetch,\n});\n\nconst jobId = process.env.GREATWAIT_JOBID;\n\nconst result = await greatwait.request(\"bulk_read\", jobId);",
5
+ "mcp": "// Any MCP client, against $GREATWAIT_API_URL/mcp.\n{\n \"arguments\": {\n \"jobId\": \"$JOBID\"\n },\n \"name\": \"bulk_read\"\n}"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "curl": "curl -sS -X POST \"$GREATWAIT_API_URL/v1/bulk/jobs/$GREATWAIT_JOBID/resume\" \\\n --variable %GREATWAIT_API_KEY \\\n --expand-header \"Authorization: Bearer {{GREATWAIT_API_KEY}}\" \\\n -H 'Content-Type: application/json' \\\n --data-binary '{\"expectedVersion\":1}'",
3
+ "environments": ["test", "live"],
4
+ "javascript": "import { createGreatwaitClient } from \"@greatwait/api-client\";\n\nconst greatwait = createGreatwaitClient({\n baseUrl: process.env.GREATWAIT_API_URL,\n credential: process.env.GREATWAIT_API_KEY,\n fetch,\n});\n\nconst jobId = process.env.GREATWAIT_JOBID;\n\nconst body = {\n \"expectedVersion\": 1\n};\n\nconst result = await greatwait.request(\"bulk_resume\", jobId, body);",
5
+ "mcp": "// Any MCP client, against $GREATWAIT_API_URL/mcp.\n{\n \"arguments\": {\n \"expectedVersion\": 1,\n \"jobId\": \"$JOBID\"\n },\n \"name\": \"bulk_resume\"\n}"
6
+ }
package/package.json CHANGED
@@ -154,5 +154,5 @@
154
154
  },
155
155
  "sideEffects": false,
156
156
  "type": "module",
157
- "version": "0.2.2"
157
+ "version": "0.3.0"
158
158
  }