@pigeonposse/api-2026 0.0.0-stage → 1.0.2
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/LICENSE +676 -0
- package/README.md +120 -2
- package/dist/bin.cjs +14 -0
- package/dist/bin.d.cts +1 -0
- package/dist/bin.d.mts +1 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.mjs +12 -0
- package/dist/env.cjs +21 -0
- package/dist/env.d.cts +23 -0
- package/dist/env.d.mts +23 -0
- package/dist/env.d.ts +23 -0
- package/dist/env.mjs +19 -0
- package/dist/local.cjs +15 -0
- package/dist/local.d.cts +9 -0
- package/dist/local.d.mts +7 -0
- package/dist/local.d.ts +9 -0
- package/dist/local.mjs +6 -0
- package/dist/main.cjs +22 -0
- package/dist/main.d.cts +13 -0
- package/dist/main.d.mts +11 -0
- package/dist/main.d.ts +13 -0
- package/dist/main.mjs +14 -0
- package/dist/schema/banner.json +4 -0
- package/dist/schema/code-of-conduct.json +4 -0
- package/dist/schema/composer.json +4 -0
- package/dist/schema/config.json +4 -0
- package/dist/schema/contributting.json +4 -0
- package/dist/schema/logo.json +4 -0
- package/dist/schema/package.json +4 -0
- package/dist/schema/readme.json +4 -0
- package/dist/schema/security.json +4 -0
- package/dist/schema/support.json +4 -0
- package/dist/server.cjs +16 -0
- package/dist/server.d.cts +9 -0
- package/dist/server.d.mts +9 -0
- package/dist/server.d.ts +9 -0
- package/dist/server.mjs +9 -0
- package/dist/shared/api-2026.C367WW-0.cjs +34 -0
- package/dist/shared/api-2026.CDiWYIa6.mjs +25 -0
- package/dist/shared/api-2026.CrRWS0qQ.mjs +32 -0
- package/dist/shared/api-2026.DKKpCkQB.cjs +40 -0
- package/package.json +80 -3
package/README.md
CHANGED
|
@@ -1,3 +1,121 @@
|
|
|
1
|
-
#
|
|
1
|
+
# PIGEONPOSSE API
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Run the PigeonPosse API.
|
|
6
|
+
|
|
7
|
+
Rest API to get data from your GitHub repository.
|
|
8
|
+
|
|
9
|
+
- Required for [@pigeonposse/web-2026](https://www.npmjs.com/package/@pigeonposse/web-2026)
|
|
10
|
+
|
|
11
|
+
## Prerequisites
|
|
12
|
+
|
|
13
|
+
- GitHub Token [Read more](https://github.com/settings/tokens)
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm i @pigeonposse/api-2026
|
|
19
|
+
# or
|
|
20
|
+
pnpm i @pigeonposse/api-2026
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## CLI Usage
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
GH_TOKEN="your-github-token" GH_USER="your-github-user" npx @pigeonposse/api-2026
|
|
27
|
+
# or
|
|
28
|
+
GH_TOKEN="your-github-token" GH_USER="your-github-user" pnpx @pigeonposse/api-2026
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or with a installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm i @pigeonposse/api-2026
|
|
35
|
+
GH_TOKEN="your-github-token" npm exec pigeonposse-api-2026
|
|
36
|
+
# or
|
|
37
|
+
pnpm i @pigeonposse/api-2026
|
|
38
|
+
GH_TOKEN="your-github-token" GH_USER="your-github-user" pnpm exec pigeonposse-api-2026
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Library Usage
|
|
42
|
+
|
|
43
|
+
### Standard server
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
import { createServer } from '@pigeonposse/api-2026' // OR: import { createServer } from '@pigeonposse/api-2026/server'
|
|
47
|
+
createServer( {
|
|
48
|
+
DEBUG: 'false',
|
|
49
|
+
GH_TOKEN: "your-github-token",
|
|
50
|
+
GH_USER: 'angelespejo',
|
|
51
|
+
GH_BRANCH: 'main',
|
|
52
|
+
GH_USER_TYPE: 'user',
|
|
53
|
+
API_PORT: 1312,
|
|
54
|
+
API_STORE_PATH: 'build/store/pigeonposse.json'
|
|
55
|
+
} )
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
node standard-server.js
|
|
60
|
+
## Override OPTION
|
|
61
|
+
DEBUG=true node standard-server.js
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Local server
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
import { createLocalServer } from '@pigeonposse/api-2026' // OR: import { createLocalServer } from '@pigeonposse/api-2026/server'
|
|
68
|
+
|
|
69
|
+
createLocalServer( {
|
|
70
|
+
DEBUG: 'false',
|
|
71
|
+
GH_TOKEN: "your-github-token",
|
|
72
|
+
GH_USER: 'angelespejo',
|
|
73
|
+
GH_BRANCH: 'main',
|
|
74
|
+
GH_USER_TYPE: 'user',
|
|
75
|
+
API_PORT: 1312,
|
|
76
|
+
API_STORE_PATH: 'build/store/pigeonposse.json'
|
|
77
|
+
} )
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
node local-server.js
|
|
82
|
+
## Override OPTION
|
|
83
|
+
DEBUG=true node local-server.js
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Custom server
|
|
87
|
+
|
|
88
|
+
You can use only the app, for build your server wetheaver you want.
|
|
89
|
+
|
|
90
|
+
### Standard app
|
|
91
|
+
|
|
92
|
+
```js
|
|
93
|
+
import { appStandard } from '@pigeonposse/api-2026' // OR: import app from '@pigeonposse/api-2026/standard'
|
|
94
|
+
|
|
95
|
+
// Build you server
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Local app
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
import { appLocal } from '@pigeonposse/api-2026' // OR: import app from '@pigeonposse/api-2026/local'
|
|
102
|
+
|
|
103
|
+
// Build you server
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Change enviroment variables
|
|
107
|
+
|
|
108
|
+
```js
|
|
109
|
+
import { ENV } from '@pigeonposse/api-2026' // OR: import { ENV } from '@pigeonposse/api-2026/env'
|
|
110
|
+
|
|
111
|
+
ENV.DEBUG = 'true'
|
|
112
|
+
ENV.GH_USER='angelespejo'
|
|
113
|
+
ENV.GH_BRANCH='main'
|
|
114
|
+
ENV.GH_USER_TYPE='user'
|
|
115
|
+
|
|
116
|
+
// Do something
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Add custom config in your repositories
|
|
120
|
+
|
|
121
|
+
This package use Collectium Github Preset for get Github data. For more information read [Docs](https://collectium.pigeonposse.com/guide/preset/github/)
|
package/dist/bin.cjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const server = require('./shared/api-2026.DKKpCkQB.cjs');
|
|
5
|
+
require('@backan/server');
|
|
6
|
+
require('./env.cjs');
|
|
7
|
+
require('@pigeonposse/api-config-2026');
|
|
8
|
+
require('./shared/api-2026.C367WW-0.cjs');
|
|
9
|
+
require('@collectium/api/local');
|
|
10
|
+
require('@collectium/core');
|
|
11
|
+
require('node:util');
|
|
12
|
+
require('@collectium/api/standard');
|
|
13
|
+
|
|
14
|
+
server.createLocalServer();
|
package/dist/bin.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/bin.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/bin.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { c as createLocalServer } from './shared/api-2026.CrRWS0qQ.mjs';
|
|
3
|
+
import '@backan/server';
|
|
4
|
+
import './env.mjs';
|
|
5
|
+
import '@pigeonposse/api-config-2026';
|
|
6
|
+
import './shared/api-2026.CDiWYIa6.mjs';
|
|
7
|
+
import '@collectium/api/local';
|
|
8
|
+
import '@collectium/core';
|
|
9
|
+
import 'node:util';
|
|
10
|
+
import '@collectium/api/standard';
|
|
11
|
+
|
|
12
|
+
createLocalServer();
|
package/dist/env.cjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const config = require('@pigeonposse/api-config-2026');
|
|
4
|
+
|
|
5
|
+
const ENV = {
|
|
6
|
+
...config.ENV,
|
|
7
|
+
/**
|
|
8
|
+
* Used in server.
|
|
9
|
+
*
|
|
10
|
+
* @default 1312
|
|
11
|
+
*/
|
|
12
|
+
API_PORT: Number(globalThis.process.env.API_PORT) || 1312,
|
|
13
|
+
/**
|
|
14
|
+
* Used in server.
|
|
15
|
+
*
|
|
16
|
+
* @default 'build/store/pigeonposse-api.json'
|
|
17
|
+
*/
|
|
18
|
+
API_STORE_PATH: globalThis.process.env.API_STORE_PATH || "build/store/pigeonposse-api.json"
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.ENV = ENV;
|
package/dist/env.d.cts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type Env = typeof ENV;
|
|
2
|
+
declare const ENV: {
|
|
3
|
+
/**
|
|
4
|
+
* Used in server.
|
|
5
|
+
*
|
|
6
|
+
* @default 1312
|
|
7
|
+
*/
|
|
8
|
+
API_PORT: number;
|
|
9
|
+
/**
|
|
10
|
+
* Used in server.
|
|
11
|
+
*
|
|
12
|
+
* @default 'build/store/pigeonposse-api.json'
|
|
13
|
+
*/
|
|
14
|
+
API_STORE_PATH: string;
|
|
15
|
+
DEBUG: "true" | "false" | undefined;
|
|
16
|
+
GH_TOKEN: string | undefined;
|
|
17
|
+
GH_USER: string;
|
|
18
|
+
GH_BRANCH: string;
|
|
19
|
+
GH_USER_TYPE: "org" | "user" | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { ENV };
|
|
23
|
+
export type { Env };
|
package/dist/env.d.mts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type Env = typeof ENV;
|
|
2
|
+
declare const ENV: {
|
|
3
|
+
/**
|
|
4
|
+
* Used in server.
|
|
5
|
+
*
|
|
6
|
+
* @default 1312
|
|
7
|
+
*/
|
|
8
|
+
API_PORT: number;
|
|
9
|
+
/**
|
|
10
|
+
* Used in server.
|
|
11
|
+
*
|
|
12
|
+
* @default 'build/store/pigeonposse-api.json'
|
|
13
|
+
*/
|
|
14
|
+
API_STORE_PATH: string;
|
|
15
|
+
DEBUG: "true" | "false" | undefined;
|
|
16
|
+
GH_TOKEN: string | undefined;
|
|
17
|
+
GH_USER: string;
|
|
18
|
+
GH_BRANCH: string;
|
|
19
|
+
GH_USER_TYPE: "org" | "user" | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { ENV };
|
|
23
|
+
export type { Env };
|
package/dist/env.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type Env = typeof ENV;
|
|
2
|
+
declare const ENV: {
|
|
3
|
+
/**
|
|
4
|
+
* Used in server.
|
|
5
|
+
*
|
|
6
|
+
* @default 1312
|
|
7
|
+
*/
|
|
8
|
+
API_PORT: number;
|
|
9
|
+
/**
|
|
10
|
+
* Used in server.
|
|
11
|
+
*
|
|
12
|
+
* @default 'build/store/pigeonposse-api.json'
|
|
13
|
+
*/
|
|
14
|
+
API_STORE_PATH: string;
|
|
15
|
+
DEBUG: "true" | "false" | undefined;
|
|
16
|
+
GH_TOKEN: string | undefined;
|
|
17
|
+
GH_USER: string;
|
|
18
|
+
GH_BRANCH: string;
|
|
19
|
+
GH_USER_TYPE: "org" | "user" | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { ENV };
|
|
23
|
+
export type { Env };
|
package/dist/env.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ENV as ENV$1 } from '@pigeonposse/api-config-2026';
|
|
2
|
+
|
|
3
|
+
const ENV = {
|
|
4
|
+
...ENV$1,
|
|
5
|
+
/**
|
|
6
|
+
* Used in server.
|
|
7
|
+
*
|
|
8
|
+
* @default 1312
|
|
9
|
+
*/
|
|
10
|
+
API_PORT: Number(globalThis.process.env.API_PORT) || 1312,
|
|
11
|
+
/**
|
|
12
|
+
* Used in server.
|
|
13
|
+
*
|
|
14
|
+
* @default 'build/store/pigeonposse-api.json'
|
|
15
|
+
*/
|
|
16
|
+
API_STORE_PATH: globalThis.process.env.API_STORE_PATH || "build/store/pigeonposse-api.json"
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { ENV };
|
package/dist/local.cjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('@collectium/api/local');
|
|
6
|
+
require('./env.cjs');
|
|
7
|
+
const local = require('./shared/api-2026.C367WW-0.cjs');
|
|
8
|
+
require('@pigeonposse/api-config-2026');
|
|
9
|
+
require('@collectium/core');
|
|
10
|
+
require('node:util');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
exports.appLocal = local.appLocal;
|
|
15
|
+
exports.default = local.appLocal;
|
package/dist/local.d.cts
ADDED
package/dist/local.d.mts
ADDED
package/dist/local.d.ts
ADDED
package/dist/local.mjs
ADDED
package/dist/main.cjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const env = require('./env.cjs');
|
|
6
|
+
const local = require('./shared/api-2026.C367WW-0.cjs');
|
|
7
|
+
const server = require('./shared/api-2026.DKKpCkQB.cjs');
|
|
8
|
+
require('@pigeonposse/api-config-2026');
|
|
9
|
+
require('@collectium/api/local');
|
|
10
|
+
require('@collectium/core');
|
|
11
|
+
require('node:util');
|
|
12
|
+
require('@backan/server');
|
|
13
|
+
require('@collectium/api/standard');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
exports.ENV = env.ENV;
|
|
18
|
+
exports.appLocal = local.appLocal;
|
|
19
|
+
exports.appStandard = server.appStandard;
|
|
20
|
+
exports.createLocalServer = server.createLocalServer;
|
|
21
|
+
exports.createServer = server.createServer;
|
|
22
|
+
exports.default = server.appStandard;
|
package/dist/main.d.cts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { ENV, Env } from './env.cjs';
|
|
2
|
+
export { AppLocalRes, appLocal } from './local.cjs';
|
|
3
|
+
import createApp from '@collectium/api/standard';
|
|
4
|
+
export { CreateLocalServerProps, CreateServerProps, createLocalServer, createServer } from './server.cjs';
|
|
5
|
+
import '@collectium/api/local';
|
|
6
|
+
|
|
7
|
+
type AppStandardRes = ReturnType<typeof createApp>;
|
|
8
|
+
declare const appStandard: () => AppStandardRes;
|
|
9
|
+
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
export = appStandard;
|
|
12
|
+
export { appStandard };
|
|
13
|
+
export type { AppStandardRes };
|
package/dist/main.d.mts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { ENV, Env } from './env.mjs';
|
|
2
|
+
export { AppLocalRes, appLocal } from './local.mjs';
|
|
3
|
+
import createApp from '@collectium/api/standard';
|
|
4
|
+
export { CreateLocalServerProps, CreateServerProps, createLocalServer, createServer } from './server.mjs';
|
|
5
|
+
import '@collectium/api/local';
|
|
6
|
+
|
|
7
|
+
type AppStandardRes = ReturnType<typeof createApp>;
|
|
8
|
+
declare const appStandard: () => AppStandardRes;
|
|
9
|
+
|
|
10
|
+
export { appStandard, appStandard as default };
|
|
11
|
+
export type { AppStandardRes };
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { ENV, Env } from './env.js';
|
|
2
|
+
export { AppLocalRes, appLocal } from './local.js';
|
|
3
|
+
import createApp from '@collectium/api/standard';
|
|
4
|
+
export { CreateLocalServerProps, CreateServerProps, createLocalServer, createServer } from './server.js';
|
|
5
|
+
import '@collectium/api/local';
|
|
6
|
+
|
|
7
|
+
type AppStandardRes = ReturnType<typeof createApp>;
|
|
8
|
+
declare const appStandard: () => AppStandardRes;
|
|
9
|
+
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
export = appStandard;
|
|
12
|
+
export { appStandard };
|
|
13
|
+
export type { AppStandardRes };
|
package/dist/main.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { ENV } from './env.mjs';
|
|
2
|
+
export { a as appLocal } from './shared/api-2026.CDiWYIa6.mjs';
|
|
3
|
+
import { a as appStandard } from './shared/api-2026.CrRWS0qQ.mjs';
|
|
4
|
+
export { c as createLocalServer, b as createServer } from './shared/api-2026.CrRWS0qQ.mjs';
|
|
5
|
+
import '@pigeonposse/api-config-2026';
|
|
6
|
+
import '@collectium/api/local';
|
|
7
|
+
import '@collectium/core';
|
|
8
|
+
import 'node:util';
|
|
9
|
+
import '@backan/server';
|
|
10
|
+
import '@collectium/api/standard';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export { appStandard, appStandard as default };
|
package/dist/server.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('@backan/server');
|
|
4
|
+
require('./env.cjs');
|
|
5
|
+
require('./shared/api-2026.C367WW-0.cjs');
|
|
6
|
+
const server = require('./shared/api-2026.DKKpCkQB.cjs');
|
|
7
|
+
require('@pigeonposse/api-config-2026');
|
|
8
|
+
require('@collectium/api/local');
|
|
9
|
+
require('@collectium/core');
|
|
10
|
+
require('node:util');
|
|
11
|
+
require('@collectium/api/standard');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.createLocalServer = server.createLocalServer;
|
|
16
|
+
exports.createServer = server.createServer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Env } from './env.cjs';
|
|
2
|
+
|
|
3
|
+
type CreateLocalServerProps = Partial<Env>;
|
|
4
|
+
type CreateServerProps = Omit<Partial<Env>, 'API_STORE_PATH'>;
|
|
5
|
+
declare const createServer: (props?: CreateServerProps) => Promise<void>;
|
|
6
|
+
declare const createLocalServer: (props?: CreateLocalServerProps) => Promise<void>;
|
|
7
|
+
|
|
8
|
+
export { createLocalServer, createServer };
|
|
9
|
+
export type { CreateLocalServerProps, CreateServerProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Env } from './env.mjs';
|
|
2
|
+
|
|
3
|
+
type CreateLocalServerProps = Partial<Env>;
|
|
4
|
+
type CreateServerProps = Omit<Partial<Env>, 'API_STORE_PATH'>;
|
|
5
|
+
declare const createServer: (props?: CreateServerProps) => Promise<void>;
|
|
6
|
+
declare const createLocalServer: (props?: CreateLocalServerProps) => Promise<void>;
|
|
7
|
+
|
|
8
|
+
export { createLocalServer, createServer };
|
|
9
|
+
export type { CreateLocalServerProps, CreateServerProps };
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Env } from './env.js';
|
|
2
|
+
|
|
3
|
+
type CreateLocalServerProps = Partial<Env>;
|
|
4
|
+
type CreateServerProps = Omit<Partial<Env>, 'API_STORE_PATH'>;
|
|
5
|
+
declare const createServer: (props?: CreateServerProps) => Promise<void>;
|
|
6
|
+
declare const createLocalServer: (props?: CreateLocalServerProps) => Promise<void>;
|
|
7
|
+
|
|
8
|
+
export { createLocalServer, createServer };
|
|
9
|
+
export type { CreateLocalServerProps, CreateServerProps };
|
package/dist/server.mjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import '@backan/server';
|
|
2
|
+
import './env.mjs';
|
|
3
|
+
import './shared/api-2026.CDiWYIa6.mjs';
|
|
4
|
+
export { c as createLocalServer, b as createServer } from './shared/api-2026.CrRWS0qQ.mjs';
|
|
5
|
+
import '@pigeonposse/api-config-2026';
|
|
6
|
+
import '@collectium/api/local';
|
|
7
|
+
import '@collectium/core';
|
|
8
|
+
import 'node:util';
|
|
9
|
+
import '@collectium/api/standard';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const createApp = require('@collectium/api/local');
|
|
4
|
+
const env = require('../env.cjs');
|
|
5
|
+
const core = require('@collectium/core');
|
|
6
|
+
const config = require('@pigeonposse/api-config-2026');
|
|
7
|
+
const node_util = require('node:util');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
10
|
+
|
|
11
|
+
const createApp__default = /*#__PURE__*/_interopDefaultCompat(createApp);
|
|
12
|
+
const config__default = /*#__PURE__*/_interopDefaultCompat(config);
|
|
13
|
+
|
|
14
|
+
const collectium = new core.Collectium(config__default);
|
|
15
|
+
|
|
16
|
+
const bold = (v) => node_util.styleText("bold", v);
|
|
17
|
+
const desc = (v) => node_util.styleText("dim", v);
|
|
18
|
+
const warnOut = (v) => node_util.styleText("yellow", `${bold("\u26A0 IMPORTANT")} ${desc(v)}`);
|
|
19
|
+
const setNotifications = () => {
|
|
20
|
+
if (!env.ENV.GH_TOKEN)
|
|
21
|
+
console.warn(warnOut("Pass a Github token as an argument for the API to work fully\n"));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const appLocal = () => {
|
|
25
|
+
setNotifications();
|
|
26
|
+
return createApp__default({
|
|
27
|
+
collectium,
|
|
28
|
+
opts: { path: env.ENV.API_STORE_PATH }
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.appLocal = appLocal;
|
|
33
|
+
exports.collectium = collectium;
|
|
34
|
+
exports.setNotifications = setNotifications;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import createApp from '@collectium/api/local';
|
|
2
|
+
import { ENV } from '../env.mjs';
|
|
3
|
+
import { Collectium } from '@collectium/core';
|
|
4
|
+
import config from '@pigeonposse/api-config-2026';
|
|
5
|
+
import { styleText } from 'node:util';
|
|
6
|
+
|
|
7
|
+
const collectium = new Collectium(config);
|
|
8
|
+
|
|
9
|
+
const bold = (v) => styleText("bold", v);
|
|
10
|
+
const desc = (v) => styleText("dim", v);
|
|
11
|
+
const warnOut = (v) => styleText("yellow", `${bold("\u26A0 IMPORTANT")} ${desc(v)}`);
|
|
12
|
+
const setNotifications = () => {
|
|
13
|
+
if (!ENV.GH_TOKEN)
|
|
14
|
+
console.warn(warnOut("Pass a Github token as an argument for the API to work fully\n"));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const appLocal = () => {
|
|
18
|
+
setNotifications();
|
|
19
|
+
return createApp({
|
|
20
|
+
collectium,
|
|
21
|
+
opts: { path: ENV.API_STORE_PATH }
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { appLocal as a, collectium as c, setNotifications as s };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { server } from '@backan/server';
|
|
2
|
+
import { ENV } from '../env.mjs';
|
|
3
|
+
import { s as setNotifications, c as collectium, a as appLocal } from './api-2026.CDiWYIa6.mjs';
|
|
4
|
+
import createApp from '@collectium/api/standard';
|
|
5
|
+
|
|
6
|
+
const appStandard = () => {
|
|
7
|
+
setNotifications();
|
|
8
|
+
return createApp({ collectium });
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const createServer = async (props) => {
|
|
12
|
+
if (props) Object.entries(props).forEach(([key, value]) => {
|
|
13
|
+
if (key in ENV) ENV[key] = value;
|
|
14
|
+
});
|
|
15
|
+
if (ENV.DEBUG === "true") console.log({ ENV });
|
|
16
|
+
await server({
|
|
17
|
+
app: appStandard(),
|
|
18
|
+
port: ENV.API_PORT
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
const createLocalServer = async (props) => {
|
|
22
|
+
if (props) Object.entries(props).forEach(([key, value]) => {
|
|
23
|
+
if (key in ENV) ENV[key] = value;
|
|
24
|
+
});
|
|
25
|
+
if (ENV.DEBUG === "true") console.log({ ENV });
|
|
26
|
+
await server({
|
|
27
|
+
app: appLocal(),
|
|
28
|
+
port: ENV.API_PORT
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { appStandard as a, createServer as b, createLocalServer as c };
|