@foundingbot/util 0.0.0-stage → 0.1.5

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,50 @@
1
+ # @foundingbot/util
2
+
3
+ ## 0.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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.
8
+
9
+ ## 0.1.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [#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.
14
+
15
+ - [#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.
16
+
17
+ - [#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.
18
+
19
+ ## 0.1.3
20
+
21
+ ### Patch Changes
22
+
23
+ - [#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.
24
+
25
+ ## 0.1.2
26
+
27
+ ### Patch Changes
28
+
29
+ - [#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.
30
+
31
+ ## 0.1.1
32
+
33
+ ### Patch Changes
34
+
35
+ - [#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.
36
+
37
+ - [#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.
38
+
39
+ - [#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.
40
+ Require service URLs to be configured explicitly, retaining the CLI's production default.
41
+
42
+ ## 0.1.0
43
+
44
+ ### Minor Changes
45
+
46
+ - [`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.
47
+
48
+ ### Patch Changes
49
+
50
+ - [`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,6 +1,28 @@
1
1
  {
2
2
  "name": "@foundingbot/util",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.5",
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
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/phuctm97/foundingbot.git",
18
+ "directory": "packages/util"
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "CHANGELOG.md"
23
+ ],
24
+ "publishConfig": {
25
+ "registry": "https://registry.npmjs.org",
26
+ "access": "public"
27
+ }
28
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.