@sealkeeper/schema 0.4.5 → 0.4.7

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 (73) hide show
  1. package/README.md +2 -2
  2. package/dist/api.d.ts +30 -38
  3. package/dist/api.js +87 -42
  4. package/dist/client-address.d.ts +6 -0
  5. package/dist/client-address.js +81 -0
  6. package/dist/credential.d.ts +1 -66
  7. package/dist/credential.js +25 -63
  8. package/dist/events.d.ts +1 -0
  9. package/dist/events.js +13 -1
  10. package/dist/goal.js +2 -2
  11. package/dist/hidden.d.ts +1 -0
  12. package/dist/hidden.js +5 -0
  13. package/dist/index.d.ts +3 -1
  14. package/dist/index.js +3 -1
  15. package/dist/json-shape.d.ts +9 -0
  16. package/dist/json-shape.js +70 -0
  17. package/dist/moderation.d.ts +2 -1
  18. package/dist/moderation.js +169 -75
  19. package/dist/seal-conformance.js +2 -2
  20. package/dist/seal-verify.d.ts +21 -0
  21. package/dist/seal-verify.js +63 -0
  22. package/dist/standing.js +1 -1
  23. package/dist/tasks.d.ts +2 -0
  24. package/dist/tasks.js +14 -4
  25. package/package.json +2 -6
  26. package/dist/db/agent-milestones.d.ts +0 -75
  27. package/dist/db/agent-milestones.js +0 -16
  28. package/dist/db/agent-renames.d.ts +0 -126
  29. package/dist/db/agent-renames.js +0 -20
  30. package/dist/db/agents.d.ts +0 -266
  31. package/dist/db/agents.js +0 -79
  32. package/dist/db/client.d.ts +0 -2471
  33. package/dist/db/client.js +0 -40
  34. package/dist/db/credentials.d.ts +0 -143
  35. package/dist/db/credentials.js +0 -16
  36. package/dist/db/deleted-operators.d.ts +0 -75
  37. package/dist/db/deleted-operators.js +0 -13
  38. package/dist/db/events.d.ts +0 -160
  39. package/dist/db/events.js +0 -41
  40. package/dist/db/feed-items.d.ts +0 -109
  41. package/dist/db/feed-items.js +0 -21
  42. package/dist/db/index.d.ts +0 -76
  43. package/dist/db/index.js +0 -28
  44. package/dist/db/migrate.d.ts +0 -1
  45. package/dist/db/migrate.js +0 -34
  46. package/dist/db/migrator.d.ts +0 -4
  47. package/dist/db/migrator.js +0 -26
  48. package/dist/db/operator-identities.d.ts +0 -211
  49. package/dist/db/operator-identities.js +0 -49
  50. package/dist/db/operator-level-grants.d.ts +0 -109
  51. package/dist/db/operator-level-grants.js +0 -30
  52. package/dist/db/operator-slugs.d.ts +0 -92
  53. package/dist/db/operator-slugs.js +0 -25
  54. package/dist/db/operators.d.ts +0 -228
  55. package/dist/db/operators.js +0 -39
  56. package/dist/db/quota-counters.d.ts +0 -109
  57. package/dist/db/quota-counters.js +0 -17
  58. package/dist/db/ratings.d.ts +0 -160
  59. package/dist/db/ratings.js +0 -27
  60. package/dist/db/scores.d.ts +0 -160
  61. package/dist/db/scores.js +0 -15
  62. package/dist/db/standing.d.ts +0 -264
  63. package/dist/db/standing.js +0 -34
  64. package/dist/db/task-claim-failures.d.ts +0 -143
  65. package/dist/db/task-claim-failures.js +0 -37
  66. package/dist/db/task-outcomes.d.ts +0 -145
  67. package/dist/db/task-outcomes.js +0 -25
  68. package/dist/db/tasks.d.ts +0 -381
  69. package/dist/db/tasks.js +0 -100
  70. package/dist/db/timestamps.d.ts +0 -4
  71. package/dist/db/timestamps.js +0 -24
  72. package/dist/db/url.d.ts +0 -12
  73. package/dist/db/url.js +0 -25
package/dist/db/url.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import type { Options } from 'postgres';
2
- /**
3
- * Turns DATABASE_URL into arguments for postgres.js.
4
- *
5
- * On Cloud Run the URL uses the Cloud SQL socket form with an empty host,
6
- * `postgres://user:pass@/db?host=/cloudsql/project:region:instance`.
7
- * postgres.js cannot parse an empty host and ignores `?host=`, so this moves
8
- * the socket directory into the `path` option. Other URLs pass through.
9
- *
10
- * Errors never include the URL, because it carries the password.
11
- */
12
- export declare function pgArgs(databaseUrl: string): [string, Options<never>];
package/dist/db/url.js DELETED
@@ -1,25 +0,0 @@
1
- /**
2
- * Turns DATABASE_URL into arguments for postgres.js.
3
- *
4
- * On Cloud Run the URL uses the Cloud SQL socket form with an empty host,
5
- * `postgres://user:pass@/db?host=/cloudsql/project:region:instance`.
6
- * postgres.js cannot parse an empty host and ignores `?host=`, so this moves
7
- * the socket directory into the `path` option. Other URLs pass through.
8
- *
9
- * Errors never include the URL, because it carries the password.
10
- */
11
- export function pgArgs(databaseUrl) {
12
- const withHost = databaseUrl.replace(/^(postgres(?:ql)?:\/\/[^/@]*@)\//, '$1localhost/');
13
- let u;
14
- try {
15
- u = new URL(withHost);
16
- }
17
- catch {
18
- throw new Error('DATABASE_URL is not a valid postgres URL');
19
- }
20
- const socketDir = u.searchParams.get('host');
21
- if (!socketDir)
22
- return [databaseUrl, {}];
23
- u.searchParams.delete('host');
24
- return [u.toString(), { path: `${socketDir}/.s.PGSQL.${u.port || 5432}` }];
25
- }