@foundingbot/util 0.0.0 → 0.1.6

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/CHANGELOG.md ADDED
@@ -0,0 +1,58 @@
1
+ # @foundingbot/util
2
+
3
+ ## 0.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#66](https://github.com/phuctm97/foundingbot/pull/66) [`dcd201f`](https://github.com/phuctm97/foundingbot/commit/dcd201fbfeceb4a59e4eeee91b882156a6ca3cfc) Thanks [@kittranofficial](https://github.com/kittranofficial)! - Publish the CLI as both @foundingbot/cli and foundingbot on npm without source maps and on Verdaccio with source maps. Keep scoped Verdaccio publishing restricted; unscoped access is controlled by Verdaccio’s server permissions.
8
+
9
+ Build each CLI and utility release after preparing its final package manifest so bundled metadata matches the published package.
10
+
11
+ ## 0.1.5
12
+
13
+ ### Patch Changes
14
+
15
+ - [#64](https://github.com/phuctm97/foundingbot/pull/64) [`532be99`](https://github.com/phuctm97/foundingbot/commit/532be99290b01099fd22c7bcfc64a566d6a40159) Thanks [@kittranofficial](https://github.com/kittranofficial)! - Use a current npm CLI to support GitHub OIDC trusted publishing.
16
+
17
+ ## 0.1.4
18
+
19
+ ### Patch Changes
20
+
21
+ - [#61](https://github.com/phuctm97/foundingbot/pull/61) [`400c483`](https://github.com/phuctm97/foundingbot/commit/400c483f9b846e14ed034a6b36e5be7fbe8cdc52) Thanks [@kittranofficial](https://github.com/kittranofficial)! - Bundle published JavaScript and TypeScript declarations with tsdown while preserving source-based workspace imports.
22
+
23
+ - [#62](https://github.com/phuctm97/foundingbot/pull/62) [`b970176`](https://github.com/phuctm97/foundingbot/commit/b97017643c9e66995f0b949015eb7b4ab4b12aeb) Thanks [@kittranofficial](https://github.com/kittranofficial)! - Publish compiled CLI JavaScript and source maps to the private registry. Pack CLI and utility releases with Bun to resolve workspace dependencies automatically, keeping source manifests private until release.
24
+
25
+ - [#63](https://github.com/phuctm97/foundingbot/pull/63) [`d693770`](https://github.com/phuctm97/foundingbot/commit/d6937703e22ec1a697037d3ff8d965e3ed0a855d) Thanks [@kittranofficial](https://github.com/kittranofficial)! - Publish the utility package publicly on npm without source maps, while retaining restricted Verdaccio releases with source maps.
26
+
27
+ ## 0.1.3
28
+
29
+ ### Patch Changes
30
+
31
+ - [#59](https://github.com/phuctm97/foundingbot/pull/59) [`b459988`](https://github.com/phuctm97/foundingbot/commit/b4599888882634bf95079d48411765cf3245269e) Thanks [@phuctm97](https://github.com/phuctm97)! - Publish compiled JavaScript and TypeScript declarations for use without a bundler or TypeScript runtime.
32
+
33
+ ## 0.1.2
34
+
35
+ ### Patch Changes
36
+
37
+ - [#58](https://github.com/phuctm97/foundingbot/pull/58) [`8840e3e`](https://github.com/phuctm97/foundingbot/commit/8840e3e7e4ceee0dceee527e3c8f751ccf63d950) Thanks [@phuctm97](https://github.com/phuctm97)! - Restore automatic utility package publication through individual release-tag pushes.
38
+
39
+ ## 0.1.1
40
+
41
+ ### Patch Changes
42
+
43
+ - [#52](https://github.com/phuctm97/foundingbot/pull/52) [`7e1e70a`](https://github.com/phuctm97/foundingbot/commit/7e1e70a95649dd9de166d81ae402e85ab1cdc57b) Thanks [@kittranofficial](https://github.com/kittranofficial)! - Add an authenticated bot rebuild endpoint that replaces the machine and resets machine-local data while preserving ownership, subscription, and runtime choice.
44
+
45
+ - [#56](https://github.com/phuctm97/foundingbot/pull/56) [`549a11a`](https://github.com/phuctm97/foundingbot/commit/549a11a9228e7523231fc01d4fa2fa32b56cb7a0) Thanks [@phuctm97](https://github.com/phuctm97)! - Publish TypeScript sources to the private Verdaccio registry when utility release tags are pushed.
46
+
47
+ - [#51](https://github.com/phuctm97/foundingbot/pull/51) [`0e93a4c`](https://github.com/phuctm97/foundingbot/commit/0e93a4c1d50a6f29bef1957205cc7e6c535bc66f) Thanks [@kittranofficial](https://github.com/kittranofficial)! - Move environment configuration from shared utilities into the consuming packages.
48
+ Require service URLs to be configured explicitly, retaining the CLI's production default.
49
+
50
+ ## 0.1.0
51
+
52
+ ### Minor Changes
53
+
54
+ - [`c6cc606`](https://github.com/phuctm97/foundingbot/commit/c6cc6067602c6905c996698b60071949d9990bee) Thanks [@kittranofficial](https://github.com/kittranofficial)! - Open Stripe Checkout from the CLI and activate bots after Checkout completes, safely canceling duplicate subscriptions.
55
+
56
+ ### Patch Changes
57
+
58
+ - [`64ba787`](https://github.com/phuctm97/foundingbot/commit/64ba7875eafce3b4862f81dc1178dba7529f096b) Thanks [@kittranofficial](https://github.com/kittranofficial)! - Update external dependencies to their latest releases.
@@ -0,0 +1,78 @@
1
+ import { ContractRouterClient } from "@orpc/contract";
2
+ import { z } from "zod";
3
+ declare namespace contract_d_exports {
4
+ export { activateBot, checkUsage, grantUsageReset, listBots, manageBilling, ping, rebuildBot, recordUsage, removeBot, repairBot, resetUsage, viewUsage };
5
+ }
6
+ declare const activateBot: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
7
+ activationCode: z.ZodString;
8
+ }, z.core.$strip>, z.ZodObject<{
9
+ url: z.ZodURL;
10
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
11
+ declare const listBots: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodArray<z.ZodObject<{
12
+ name: z.ZodString;
13
+ telegramBotUsername: z.ZodString;
14
+ telegramBotId: z.ZodNumber;
15
+ }, z.core.$strip>>, Record<never, never>, Record<never, never>>;
16
+ declare const repairBot: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
17
+ telegramBotId: z.ZodNumber;
18
+ }, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
19
+ declare const rebuildBot: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
20
+ telegramBotId: z.ZodNumber;
21
+ }, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
22
+ declare const removeBot: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
23
+ telegramBotId: z.ZodNumber;
24
+ }, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
25
+ declare const checkUsage: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
26
+ telegramBotId: z.ZodNumber;
27
+ telegramUserId: z.ZodNumber;
28
+ ownerId: z.ZodString;
29
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
30
+ declare const recordUsage: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
31
+ serviceId: z.ZodString;
32
+ requestId: z.ZodString;
33
+ usdMicros: z.ZodNumber;
34
+ }, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
35
+ declare const viewUsage: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
36
+ telegramBotId: z.ZodCoercedNumber<number>;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ status: z.ZodNullable<z.ZodEnum<{
39
+ broken: "broken";
40
+ pending: "pending";
41
+ running: "running";
42
+ }>>;
43
+ subscription: z.ZodNullable<z.ZodObject<{
44
+ plan: z.ZodEnum<{
45
+ max: "max";
46
+ plus: "plus";
47
+ pro: "pro";
48
+ }>;
49
+ price: z.ZodObject<{
50
+ currency: z.ZodString;
51
+ amount: z.ZodNumber;
52
+ duration: z.ZodObject<{
53
+ unit: z.ZodString;
54
+ count: z.ZodNumber;
55
+ }, z.core.$strip>;
56
+ }, z.core.$strip>;
57
+ usage: z.ZodObject<{
58
+ fiveHourUsedPercent: z.ZodNumber;
59
+ weeklyUsedPercent: z.ZodNumber;
60
+ availableResets: z.ZodNumber;
61
+ }, z.core.$strip>;
62
+ }, z.core.$strip>>;
63
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
64
+ declare const resetUsage: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
65
+ telegramBotId: z.ZodNumber;
66
+ }, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
67
+ declare const manageBilling: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
68
+ url: z.ZodURL;
69
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
70
+ declare const grantUsageReset: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
71
+ telegramBotId: z.ZodNumber;
72
+ }, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
73
+ declare const ping: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodLiteral<"pong">, Record<never, never>, Record<never, never>>;
74
+ //#endregion
75
+ //#region lib/types.d.ts
76
+ type ContractClient = ContractRouterClient<typeof contract_d_exports>;
77
+ //#endregion
78
+ export { type ContractClient, contract_d_exports as contract };
@@ -0,0 +1 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.mjs";import{oc as t}from"@orpc/contract";import{z as n}from"zod";var r=/* @__PURE__ */ e({activateBot:()=>i,checkUsage:()=>l,grantUsageReset:()=>m,listBots:()=>a,manageBilling:()=>p,ping:()=>h,rebuildBot:()=>s,recordUsage:()=>u,removeBot:()=>c,repairBot:()=>o,resetUsage:()=>f,viewUsage:()=>d});const i=t.route({method:`POST`,path:`/bots/activate`}).input(n.object({activationCode:n.string().regex(/^[a-f0-9]{64}$/)})).output(n.object({url:n.url()})),a=t.route({method:`GET`,path:`/bots`}).output(n.array(n.object({name:n.string().min(1),telegramBotUsername:n.string().min(1),telegramBotId:n.number().int().positive()}))),o=t.route({method:`POST`,path:`/bots/repair`}).input(n.object({telegramBotId:n.number().int().positive()})).output(n.void()),s=t.route({method:`POST`,path:`/bots/rebuild`}).input(n.object({telegramBotId:n.number().int().positive()})).output(n.void()),c=t.route({method:`POST`,path:`/bots/remove`}).input(n.object({telegramBotId:n.number().int().positive()})).output(n.void()),l=t.route({method:`GET`,path:`/bots/usage`}).output(n.object({telegramBotId:n.number().int().positive(),telegramUserId:n.number().int().positive(),ownerId:n.string().min(1)})),u=t.route({method:`POST`,path:`/bots/usage`}).input(n.object({serviceId:n.string().min(1),requestId:n.string().min(1),usdMicros:n.number().int().nonnegative()})).output(n.void()),d=t.route({method:`GET`,path:`/bots/usage/view`}).input(n.object({telegramBotId:n.coerce.number().int().positive()})).output(n.object({status:n.enum([`pending`,`running`,`broken`]).nullable(),subscription:n.object({plan:n.enum([`plus`,`pro`,`max`]),price:n.object({currency:n.string().min(1),amount:n.number().int().nonnegative(),duration:n.object({unit:n.string().min(1),count:n.number().int().positive()})}),usage:n.object({fiveHourUsedPercent:n.number().int().nonnegative(),weeklyUsedPercent:n.number().int().nonnegative(),availableResets:n.number().int().nonnegative()})}).nullable()})),f=t.route({method:`POST`,path:`/bots/usage/reset`}).input(n.object({telegramBotId:n.number().int().positive()})).output(n.void()),p=t.route({method:`POST`,path:`/billing/manage`}).output(n.object({url:n.url()})),m=t.route({method:`POST`,path:`/admin/bots/usage/resets`}).input(n.object({telegramBotId:n.number().int().positive()})).output(n.void()),h=t.route({method:`GET`,path:`/ping`}).output(n.literal(`pong`));export{r as contract};
@@ -0,0 +1 @@
1
+ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};export{t};
package/package.json CHANGED
@@ -1,12 +1,26 @@
1
1
  {
2
2
  "name": "@foundingbot/util",
3
- "version": "0.0.0",
3
+ "version": "0.1.6",
4
4
  "description": "Founding Bot internal utilities",
5
+ "type": "module",
6
+ "exports": {
7
+ "types": "./dist/exports.d.mts",
8
+ "default": "./dist/exports.mjs"
9
+ },
10
+ "dependencies": {
11
+ "@opentelemetry/api": "^1.9.1",
12
+ "@orpc/contract": "^1.15.4",
13
+ "zod": "^4.6.5"
14
+ },
5
15
  "repository": {
6
16
  "type": "git",
7
17
  "url": "git+https://github.com/phuctm97/foundingbot.git",
8
18
  "directory": "packages/util"
9
19
  },
20
+ "files": [
21
+ "dist",
22
+ "CHANGELOG.md"
23
+ ],
10
24
  "publishConfig": {
11
25
  "registry": "https://registry.npmjs.org",
12
26
  "access": "public"