@forgezero/providers 0.1.23 → 0.1.24
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 +67 -81
- package/dist/billing.d.ts +305 -0
- package/dist/{chain.js → billing.js} +258 -143
- package/dist/database.js +1 -1
- package/dist/email.js +1 -1
- package/dist/git.d.ts +108 -40
- package/dist/git.js +41 -19
- package/dist/http.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/pool.js +1 -1
- package/dist/storage.js +1 -1
- package/dist/translation.js +1 -1
- package/package.json +6 -10
- package/dist/binance.d.ts +0 -27
- package/dist/binance.js +0 -704
- package/dist/chain.d.ts +0 -99
package/dist/git.js
CHANGED
|
@@ -336,7 +336,7 @@ function createService(definition, methods, options = {}) {
|
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
|
-
var VERSION = "0.1.
|
|
339
|
+
var VERSION = "0.1.24";
|
|
340
340
|
|
|
341
341
|
// src/git.ts
|
|
342
342
|
var githubAppConfigSchema = {
|
|
@@ -344,9 +344,11 @@ var githubAppConfigSchema = {
|
|
|
344
344
|
properties: {
|
|
345
345
|
clientId: { type: "string", minLength: 10, maxLength: 128 },
|
|
346
346
|
appId: { type: "string", pattern: "^[1-9][0-9]{0,19}$" },
|
|
347
|
-
slug: { type: "string", pattern: "^[a-z0-9][a-z0-9-]{0,99}$" }
|
|
347
|
+
slug: { type: "string", pattern: "^[a-z0-9][a-z0-9-]{0,99}$" },
|
|
348
|
+
providerVersion: { type: "string", pattern: "^github-app:[a-z0-9][a-z0-9.-]{0,31}$" },
|
|
349
|
+
verifiedAtTs: { type: "integer", minimum: 1 }
|
|
348
350
|
},
|
|
349
|
-
required: ["clientId", "appId", "slug"],
|
|
351
|
+
required: ["clientId", "appId", "slug", "providerVersion", "verifiedAtTs"],
|
|
350
352
|
additionalProperties: false
|
|
351
353
|
};
|
|
352
354
|
var githubAppCredentialSchema = {
|
|
@@ -359,42 +361,62 @@ var githubAppCredentialSchema = {
|
|
|
359
361
|
required: ["clientSecret", "privateKey", "webhookSecret"],
|
|
360
362
|
additionalProperties: false
|
|
361
363
|
};
|
|
364
|
+
var oauthServerService = defineService({
|
|
365
|
+
key: "oauth-server",
|
|
366
|
+
methods: {
|
|
367
|
+
beginUserAuthorization: serviceMethod(),
|
|
368
|
+
completeUserAuthorization: serviceMethod(),
|
|
369
|
+
readVerifiedIdentity: serviceMethod(),
|
|
370
|
+
refreshUserGrant: serviceMethod(),
|
|
371
|
+
revokeUserGrant: serviceMethod()
|
|
372
|
+
}
|
|
373
|
+
});
|
|
362
374
|
var gitConnectService = defineService({
|
|
363
375
|
key: "git-connect",
|
|
364
376
|
methods: {
|
|
365
|
-
|
|
377
|
+
beginInstallation: serviceMethod(),
|
|
378
|
+
completeInstallation: serviceMethod(),
|
|
379
|
+
listInstallations: serviceMethod(),
|
|
366
380
|
listRepositories: serviceMethod(),
|
|
367
381
|
listBranches: serviceMethod(),
|
|
368
|
-
|
|
369
|
-
|
|
382
|
+
mintCloneCredential: serviceMethod(),
|
|
383
|
+
verifyWebhook: serviceMethod(),
|
|
384
|
+
disconnectInstallation: serviceMethod()
|
|
370
385
|
}
|
|
371
386
|
});
|
|
372
|
-
function
|
|
387
|
+
function defineGitHubProvider(args) {
|
|
373
388
|
const classify = args.classify ?? (() => "retryable");
|
|
374
389
|
const branch = (invoke) => defineProviderMethodBranches({
|
|
375
390
|
currentVersion: args.version,
|
|
376
|
-
versions: {
|
|
377
|
-
[args.version]: { version: args.version, lifecycle: "current", invoke, classify }
|
|
378
|
-
}
|
|
391
|
+
versions: { [args.version]: { version: args.version, lifecycle: "current", invoke, classify } }
|
|
379
392
|
});
|
|
380
393
|
return defineProvider({
|
|
381
|
-
id:
|
|
382
|
-
label:
|
|
383
|
-
multiInstance:
|
|
384
|
-
credentials:
|
|
385
|
-
config:
|
|
394
|
+
id: "github",
|
|
395
|
+
label: "GitHub App",
|
|
396
|
+
multiInstance: false,
|
|
397
|
+
credentials: githubAppCredentialSchema,
|
|
398
|
+
config: githubAppConfigSchema,
|
|
386
399
|
methods: {
|
|
387
|
-
|
|
400
|
+
beginUserAuthorization: branch(args.adapter.beginUserAuthorization),
|
|
401
|
+
completeUserAuthorization: branch(args.adapter.completeUserAuthorization),
|
|
402
|
+
readVerifiedIdentity: branch(args.adapter.readVerifiedIdentity),
|
|
403
|
+
refreshUserGrant: branch(args.adapter.refreshUserGrant),
|
|
404
|
+
revokeUserGrant: branch(args.adapter.revokeUserGrant),
|
|
405
|
+
beginInstallation: branch(args.adapter.beginInstallation),
|
|
406
|
+
completeInstallation: branch(args.adapter.completeInstallation),
|
|
407
|
+
listInstallations: branch(args.adapter.listInstallations),
|
|
388
408
|
listRepositories: branch(args.adapter.listRepositories),
|
|
389
409
|
listBranches: branch(args.adapter.listBranches),
|
|
390
|
-
|
|
391
|
-
|
|
410
|
+
mintCloneCredential: branch(args.adapter.mintCloneCredential),
|
|
411
|
+
verifyWebhook: branch(args.adapter.verifyWebhook),
|
|
412
|
+
disconnectInstallation: branch(args.adapter.disconnectInstallation)
|
|
392
413
|
}
|
|
393
414
|
});
|
|
394
415
|
}
|
|
395
416
|
export {
|
|
417
|
+
oauthServerService,
|
|
396
418
|
githubAppCredentialSchema,
|
|
397
419
|
githubAppConfigSchema,
|
|
398
420
|
gitConnectService,
|
|
399
|
-
|
|
421
|
+
defineGitHubProvider
|
|
400
422
|
};
|
package/dist/http.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/pool.js
CHANGED
package/dist/storage.js
CHANGED
package/dist/translation.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgezero/providers",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -15,10 +15,6 @@
|
|
|
15
15
|
"types": "./dist/email.d.ts",
|
|
16
16
|
"default": "./dist/email.js"
|
|
17
17
|
},
|
|
18
|
-
"./chain": {
|
|
19
|
-
"types": "./dist/chain.d.ts",
|
|
20
|
-
"default": "./dist/chain.js"
|
|
21
|
-
},
|
|
22
18
|
"./database": {
|
|
23
19
|
"types": "./dist/database.d.ts",
|
|
24
20
|
"default": "./dist/database.js"
|
|
@@ -35,10 +31,6 @@
|
|
|
35
31
|
"types": "./dist/pool.d.ts",
|
|
36
32
|
"default": "./dist/pool.js"
|
|
37
33
|
},
|
|
38
|
-
"./binance": {
|
|
39
|
-
"types": "./dist/binance.d.ts",
|
|
40
|
-
"default": "./dist/binance.js"
|
|
41
|
-
},
|
|
42
34
|
"./translation": {
|
|
43
35
|
"types": "./dist/translation.d.ts",
|
|
44
36
|
"default": "./dist/translation.js"
|
|
@@ -50,6 +42,10 @@
|
|
|
50
42
|
"./git": {
|
|
51
43
|
"types": "./dist/git.d.ts",
|
|
52
44
|
"default": "./dist/git.js"
|
|
45
|
+
},
|
|
46
|
+
"./billing": {
|
|
47
|
+
"types": "./dist/billing.d.ts",
|
|
48
|
+
"default": "./dist/billing.js"
|
|
53
49
|
}
|
|
54
50
|
},
|
|
55
51
|
"scripts": {
|
|
@@ -89,6 +85,6 @@
|
|
|
89
85
|
"LICENSE"
|
|
90
86
|
],
|
|
91
87
|
"dependencies": {
|
|
92
|
-
"@forgezero/runtime": "^0.1.
|
|
88
|
+
"@forgezero/runtime": "^0.1.15"
|
|
93
89
|
}
|
|
94
90
|
}
|
package/dist/binance.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { VenueError, type VenueAdapter, type MarketType, type OrderStatus } from '@forgezero/runtime/finance/venues';
|
|
2
|
-
export interface BinanceCredentials {
|
|
3
|
-
apiKey: string;
|
|
4
|
-
apiSecret: string;
|
|
5
|
-
}
|
|
6
|
-
export interface BinanceOptions {
|
|
7
|
-
credentials: BinanceCredentials;
|
|
8
|
-
/** Override for testnet, or for a test. */
|
|
9
|
-
hosts?: Partial<Record<MarketType, string>>;
|
|
10
|
-
fetch?: typeof globalThis.fetch;
|
|
11
|
-
/**
|
|
12
|
-
* How far a request may be delayed before Binance refuses it.
|
|
13
|
-
*
|
|
14
|
-
* 5s rather than the 60s maximum. A signed order that arrives a minute late
|
|
15
|
-
* is an order placed into a market that has moved, and accepting it is worse
|
|
16
|
-
* than being told to retry.
|
|
17
|
-
*/
|
|
18
|
-
recvWindowMs?: number;
|
|
19
|
-
now?: () => number;
|
|
20
|
-
}
|
|
21
|
-
/** Binance spells `BTC/USDT` as `BTCUSDT`. Denormalised here and nowhere else. */
|
|
22
|
-
export declare const binanceSymbol: (symbol: string) => string;
|
|
23
|
-
/** Binance statuses → ours. An unknown one is `rejected`, never silently `accepted`. */
|
|
24
|
-
export declare function toOrderStatus(status: string): OrderStatus;
|
|
25
|
-
export declare function createBinanceAdapter(options: BinanceOptions): VenueAdapter;
|
|
26
|
-
/** Turn a Binance error into something that names the actual cause. */
|
|
27
|
-
export declare function readBinanceError(error: unknown): VenueError | undefined;
|