Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
21eff59
some cleanup and bringing over hidden files
aarongoin May 9, 2025
30a4c03
bringing over the deploy workflow
aarongoin May 9, 2025
abacf7c
adding CI/CD workflows
aarongoin May 9, 2025
d3f36ec
updating to use npm cache instead of yarn
aarongoin May 9, 2025
f23457b
Bringing in Richard's updates!
aarongoin May 12, 2025
a40668c
Some missed cleanup, missing dev dependencies, and fixed build.
aarongoin May 13, 2025
6eccb97
hard pinned package versions (#2)
RichardDzurus May 15, 2025
814377f
adding husky pre-commit hook for linting
aarongoin May 15, 2025
2abfc5a
# Feature (4156): P3) Bug with deploying a client function after it a…
sudiptatj May 16, 2025
a221063
Fixing bug where client was not resolving dependencies correctly
aarongoin May 16, 2025
165cdc3
adding missing dependency for testing, and fixing issue where some na…
aarongoin May 16, 2025
40c5236
Handling x-poly-refs contained with function arguments that are thems…
aarongoin May 16, 2025
4178e72
improve logging of failed api function calls (#4)
eupharis May 22, 2025
c1589f1
P2) (MS) npm client: add direct execute option and MTLS option (#3)
RichardDzurus May 22, 2025
d616772
lost my logging in code review, lets go agane (#6)
eupharis May 22, 2025
d2d8376
P3) VSCode Extension: Add a Refresh Button to Tree View #4107 (#5)
sudiptatj May 26, 2025
3d9b821
4372 update contexts info from terminal (#8)
sudiptatj May 28, 2025
5174826
schema generation improvements
aarongoin Jun 4, 2025
7acfeaf
Bumping to 0.23.19 to follow Richard's PR
aarongoin Jun 4, 2025
e00684a
# Feature (2790): P4) Ability to control npx poly generate via an ext…
sudiptatj Jun 5, 2025
540feeb
try new action
eupharis Jun 5, 2025
ae09440
Revert "try new action"
eupharis Jun 5, 2025
5e8275f
Merge branch 'develop' into schema-generation-improvements
aarongoin Jun 5, 2025
3ae8deb
Bug fixes and improvements
aarongoin Jun 5, 2025
ae1bc20
fixing generated webhooks and server functions
aarongoin Jun 10, 2025
858fc89
try a KISS version of auto deploy prebuilt (#12)
eupharis Jun 10, 2025
67b878a
P1) Update typescript client to remove warnings (#7)
RichardDzurus Jun 11, 2025
1c1424d
fix server function runtime
aarongoin Jun 11, 2025
cd07681
downgrade package to fix the wrong export of subpackage issue (#14)
RichardDzurus Jun 12, 2025
7449f61
Improving safety of scrubKeys utility
aarongoin Jun 13, 2025
c03eed7
lets test the auto-update prebuilt functionality
eupharis Jun 16, 2025
eebcdbf
Changed command structure to fix windows glide bug (#15)
Daniel-Estoll Jun 16, 2025
7bb9284
Dirty deployables are now added to git after being updated (#16)
Daniel-Estoll Jun 17, 2025
049d630
Re-fixed glide commit bug (#18)
Daniel-Estoll Jun 18, 2025
e176601
Adding support for tabi tables, and fixing small bug when generating …
aarongoin Jun 18, 2025
d2164a9
4324 p2 add new field cachepolylibrary false to customfunction table …
RichardDzurus Jun 23, 2025
5be6c81
P3) TS Client: Log PolyAPI Library version on function startup (#20)
RichardDzurus Jun 23, 2025
d166c4b
Updating server function configs to support more properties, allowing…
aarongoin Jun 24, 2025
20bba63
4504 p3 glide bug npx poly prepare does not find any deployables in w…
Daniel-Estoll Jun 26, 2025
70e04b7
Making sure api function call errors aren't logged unless LOGS_ENABLE…
aarongoin Jun 26, 2025
c618ecc
Remove the welcome message for now
aarongoin Jun 26, 2025
af440e0
Windows glide duplicate deployables fix (#22)
Daniel-Estoll Jun 30, 2025
01796d8
Removing the updateOne and deleteOne queries from Tabi for now since …
aarongoin Jun 30, 2025
12ea8d3
Merge branch 'main' into develop
aarongoin Jul 1, 2025
a31103f
Warn on schema fallback (#25)
Daniel-Estoll Jul 23, 2025
a20cd0c
added scrubbing to api function requestArgs (#27)
Daniel-Estoll Jul 23, 2025
8849412
Changed import path (#29)
Daniel-Estoll Jul 24, 2025
d0e53d5
Fix scrub import again (#30)
Daniel-Estoll Jul 24, 2025
4a5d7f0
Changed warning message (#31)
Daniel-Estoll Jul 24, 2025
e50e556
assigned scrub to a variable instead of just doing nothing with it (#33)
Daniel-Estoll Jul 25, 2025
ae87976
missed on scrub call to args
eupharis Jul 25, 2025
bce46f8
lets link to the OSS repo doh
eupharis Jul 25, 2025
3dbbe57
fix
eupharis Jul 25, 2025
e59a7e8
Commented out warnings (#34)
Daniel-Estoll Jul 28, 2025
dd58490
Merge branch 'main' into develop
aarongoin Jul 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "polyapi",
"version": "0.24.8",
"version": "0.24.17",
"description": "Poly is a CLI tool to help create and manage your Poly definitions.",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/polyapi/poly-alpha",
"url": "https://github.com/polyapi/polyapi-typescript",
"directory": "packages/client"
},
"files": [
Expand Down
8 changes: 8 additions & 0 deletions src/commands/generate/schemaTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { EOL } from 'node:os';
import { SchemaRef, SchemaSpecification } from '../../types';
import { echoGenerationError } from '../../utils';
import { setGenerationErrors } from './types';
import shell from 'shelljs'
import chalk from 'chalk';

const unsafeCharacters = /(?:^\d)|[^0-9a-zA-Z_]/gi;
const unescapedSingleQuote = /\b'\b/gi;
Expand Down Expand Up @@ -678,6 +680,9 @@ const fillInUnresolvedSchemas = (specs: SchemaSpec[]): SchemaSpec[] => {
visibility: 'ENVIRONMENT',
},
};
// shell.echo(
// chalk.yellow(`WARNING: Schema '${unresolved.path}' referenced from '${spec.contextName}' is unresolved. Falling back to 'unknown' type for '${unresolved.path}'.`)
// );
schemas.set(unresolved.path, fillerSpec);
}
}
Expand All @@ -704,6 +709,9 @@ const fillInUnresolvedSchemas = (specs: SchemaSpec[]): SchemaSpec[] => {
visibility: 'ENVIRONMENT',
},
};
// shell.echo(
// chalk.yellow(`WARNING: Schema '${contextName}' referenced from '${spec.contextName}' is unresolved. Falling back to 'unknown' type for '${contextName}'.`)
// );
schemas.set(contextName, fillerSpec);
}
}
Expand Down
7 changes: 5 additions & 2 deletions templates/api-index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { axios } = require('../axios');
const { axios, scrub } = require('../axios');
const set = require('lodash/set');
const https = require('https');
const fs = require('fs');
Expand Down Expand Up @@ -78,7 +78,8 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => {
try {
responseData = JSON.stringify(data.data);
} catch (err) {}
console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', responseData);
requestArgs = scrub(requestArgs)
console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', scrubbedArgs, 'Response data:', responseData);
}

serverPreperationTimeMs = Number(polyHeaders['x-poly-execution-duration']);
Expand All @@ -96,6 +97,7 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => {
})
}).then(({ headers, data, status }) => {
if (status && (status < 200 || status >= 300) && process.env.LOGS_ENABLED) {
requestArgs = scrub(requestArgs)
console.error('Error direct executing api function with id:', id, 'Status code:', status, 'Request data:', requestArgs, 'Response data:', data.data);
}
const apiExecutionTimeMs = Date.now() - requestApiStartTime;
Expand Down Expand Up @@ -127,6 +129,7 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => {
try {
responseData = JSON.stringify(data.data);
} catch (err) {}
requestArgs = scrub(requestArgs)
console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', responseData);
}
const serverExecutionTimeMs = Number(headers['x-poly-execution-duration']);
Expand Down
33 changes: 30 additions & 3 deletions templates/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,45 @@ axios.interceptors.request.use(
}
);


const scrub = (data) => {
if (!data || typeof data !== 'object' ) return data;
const secrets = ["x_api_key", "x-api-key", "access_token", "access-token", "authorization", "api_key", "api-key", "apikey", "accesstoken", "token", "password", "key"];
if (Array.isArray(data)) {
return data.map(item => scrub(item))
}
else {
const temp = {};
for (const key of Object.keys(data)) {
if (typeof data[key] === 'object') {
temp[key] = scrub(data[key]);
} else if (secrets.includes(key.toLowerCase())) {
temp[key] = "********";
} else {
temp[key] = data[key];
}
}
return temp
}
}


const scrubKeys = (err) => {
if (err.request && typeof err.request.headers === 'object' && err.request.headers.Authorization) {
if (!err.request || typeof err.request.headers !== 'object') throw err
const temp = scrub(err.request.headers)
if (err.request.headers.Authorization) {
// Scrub any credentials in the authorization header
const [type, ...rest] = err.request.headers.Authorization.split(' ');
err.request.headers.Authorization = rest.length && type
temp.Authorization = rest.length && type
? `${type} ********`
: `********`;
}
err.request.headers = temp
throw err;
};

module.exports = {
axios,
scrubKeys
scrubKeys,
scrub
};
4 changes: 2 additions & 2 deletions templates/tabi/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ type PolyCountQuery<T extends Record<string, unknown>> = Clean<{

type PolySelectOneQuery<T extends Record<string, unknown>> = Clean<{
where?: Where<T>;
orderBy?: Record<keyof T, 'asc' | 'desc'>;
orderBy?: Partial<Record<keyof T, 'asc' | 'desc'>>;
}>;

type PolySelectManyQuery<T extends Record<string, unknown>> = Clean<{
where?: Where<T>;
limit?: number; // 1000 is max limit for now
offset?: number;
orderBy?: Record<keyof T, 'asc' | 'desc'>;
orderBy?: Partial<Record<keyof T, 'asc' | 'desc'>>;
}>;

type PolyDeleteQuery<T extends Record<string, unknown>> = Clean<{
Expand Down
Loading