@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.
- package/README.md +2 -2
- package/dist/api.d.ts +30 -38
- package/dist/api.js +87 -42
- package/dist/client-address.d.ts +6 -0
- package/dist/client-address.js +81 -0
- package/dist/credential.d.ts +1 -66
- package/dist/credential.js +25 -63
- package/dist/events.d.ts +1 -0
- package/dist/events.js +13 -1
- package/dist/goal.js +2 -2
- package/dist/hidden.d.ts +1 -0
- package/dist/hidden.js +5 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/json-shape.d.ts +9 -0
- package/dist/json-shape.js +70 -0
- package/dist/moderation.d.ts +2 -1
- package/dist/moderation.js +169 -75
- package/dist/seal-conformance.js +2 -2
- package/dist/seal-verify.d.ts +21 -0
- package/dist/seal-verify.js +63 -0
- package/dist/standing.js +1 -1
- package/dist/tasks.d.ts +2 -0
- package/dist/tasks.js +14 -4
- package/package.json +2 -6
- package/dist/db/agent-milestones.d.ts +0 -75
- package/dist/db/agent-milestones.js +0 -16
- package/dist/db/agent-renames.d.ts +0 -126
- package/dist/db/agent-renames.js +0 -20
- package/dist/db/agents.d.ts +0 -266
- package/dist/db/agents.js +0 -79
- package/dist/db/client.d.ts +0 -2471
- package/dist/db/client.js +0 -40
- package/dist/db/credentials.d.ts +0 -143
- package/dist/db/credentials.js +0 -16
- package/dist/db/deleted-operators.d.ts +0 -75
- package/dist/db/deleted-operators.js +0 -13
- package/dist/db/events.d.ts +0 -160
- package/dist/db/events.js +0 -41
- package/dist/db/feed-items.d.ts +0 -109
- package/dist/db/feed-items.js +0 -21
- package/dist/db/index.d.ts +0 -76
- package/dist/db/index.js +0 -28
- package/dist/db/migrate.d.ts +0 -1
- package/dist/db/migrate.js +0 -34
- package/dist/db/migrator.d.ts +0 -4
- package/dist/db/migrator.js +0 -26
- package/dist/db/operator-identities.d.ts +0 -211
- package/dist/db/operator-identities.js +0 -49
- package/dist/db/operator-level-grants.d.ts +0 -109
- package/dist/db/operator-level-grants.js +0 -30
- package/dist/db/operator-slugs.d.ts +0 -92
- package/dist/db/operator-slugs.js +0 -25
- package/dist/db/operators.d.ts +0 -228
- package/dist/db/operators.js +0 -39
- package/dist/db/quota-counters.d.ts +0 -109
- package/dist/db/quota-counters.js +0 -17
- package/dist/db/ratings.d.ts +0 -160
- package/dist/db/ratings.js +0 -27
- package/dist/db/scores.d.ts +0 -160
- package/dist/db/scores.js +0 -15
- package/dist/db/standing.d.ts +0 -264
- package/dist/db/standing.js +0 -34
- package/dist/db/task-claim-failures.d.ts +0 -143
- package/dist/db/task-claim-failures.js +0 -37
- package/dist/db/task-outcomes.d.ts +0 -145
- package/dist/db/task-outcomes.js +0 -25
- package/dist/db/tasks.d.ts +0 -381
- package/dist/db/tasks.js +0 -100
- package/dist/db/timestamps.d.ts +0 -4
- package/dist/db/timestamps.js +0 -24
- package/dist/db/url.d.ts +0 -12
- 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
|
-
}
|