Skip to content

Commit ab2fba1

Browse files
authored
chore: Rebranding (#47)
1 parent 86366ba commit ab2fba1

File tree

27 files changed

+182
-59
lines changed

27 files changed

+182
-59
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish AuthKit Package to NPM
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
defaults:
11+
run:
12+
working-directory: packages/connections
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: '20.x'
18+
registry-url: 'https://registry.npmjs.org/'
19+
- name: Install dependencies
20+
run: npm install
21+
- name: Build
22+
run: npm run build
23+
- name: Publish
24+
run: npm publish --access public
25+
env:
26+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# docker build --secret id=NPM_TOKEN .
55
#
66
# This keeps the NPM token out of the image history
7-
# NPM_TOKEN needs access to the @integrationos organization in NPM
7+
# NPM_TOKEN needs access to the @picahq organization in NPM
88

99
FROM node:16.13.0
1010

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ The Typescript Service is a MoleculerJS based monorepo that contains all the ser
77

88
## License
99

10-
IntegrationOS's Typescript Services is released under the [**GPL-3.0 license**](LICENSE).
10+
Pica's Typescript Services is released under the [**GPL-3.0 license**](LICENSE).

apps/event-system/services/api/routes/internal.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export const internalRoute = () => ({
3131
'v1.clients.get',
3232
'v1.clients.update',
3333
'v1.onboarding.public.init',
34+
35+
'v1.early-access.public.create',
36+
3437
],
3538
aliases: {
3639
'POST v3/users/get': 'v3.users.getUserFromToken',
@@ -65,6 +68,9 @@ export const internalRoute = () => ({
6568
// Onboarding
6669
'POST v1/onboarding/init': 'v1.onboarding.public.init',
6770

71+
// Early Access
72+
'POST v1/early-access/create': 'v1.early-access.public.create',
73+
6874
},
6975
cors: {
7076
origin: '*', //corsOk,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { GenericServiceProvider, makeOwnershipFromContextMeta } from '@libs-private/service-logic/services/genericService';
2+
import { ServiceBroker, Context } from 'moleculer';
3+
import { createEarlyAccessSchema } from './schema/create.schema';
4+
import { useEarlyAccessService } from '@libs-private/service-logic/services/early-access/useEarlyAccessService';
5+
import { CreateEarlyAccessPayload } from '@event-inc/types/early-access';
6+
import { ServiceContextMeta } from '@libs-private/data-models/types/genericService';
7+
const MongoDBAdapter = require('moleculer-db-adapter-mongo');
8+
9+
export default class EarlyAccess extends GenericServiceProvider {
10+
public constructor(public broker: ServiceBroker) {
11+
super(broker, {
12+
name: 'early-access',
13+
adapter: new MongoDBAdapter(process.env.MONGO_URI),
14+
version: 1,
15+
hooks: {},
16+
collection: 'early-access',
17+
publicActions: {
18+
create: [createEarlyAccessSchema, publicCreate]
19+
}
20+
});
21+
}
22+
}
23+
24+
const publicCreate = async (ctx: Context<unknown, ServiceContextMeta>) => {
25+
const { create } = useEarlyAccessService(ctx, makeOwnershipFromContextMeta(ctx));
26+
return (await create(ctx.params as CreateEarlyAccessPayload)).unwrap();
27+
}
28+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { createSchema } from '@libs-private/generic-schema/create.schema';
2+
3+
export const createEarlyAccessSchema = {
4+
...createSchema,
5+
companyName: {
6+
type: 'string'
7+
},
8+
companyLinkedInUrl: {
9+
type: 'string'
10+
},
11+
userLinkedInUrl: {
12+
type: 'string'
13+
},
14+
useCase: {
15+
type: 'string'
16+
},
17+
type: {
18+
type: 'string'
19+
}
20+
}

apps/event-system/services/stripe/stripe-webhook.service.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,10 @@ export default {
2828
function analyzeSubscription(subscriptionData: Stripe.SubscriptionItem[]): string {
2929
const priceIds = new Set(subscriptionData.map((item) => item.price.id));
3030

31-
if (priceIds.has(process.env.STRIPE_PRO_PLAN_PRICE_ID) && priceIds.has(process.env.STRIPE_SUPPORT_PLAN_PRICE_ID)) {
32-
return 'sub::pro_support';
33-
}
34-
3531
if (priceIds.has(process.env.STRIPE_PRO_PLAN_PRICE_ID)) {
3632
return 'sub::pro';
3733
}
3834

39-
if (priceIds.has(process.env.STRIPE_SUPPORT_PLAN_PRICE_ID)) {
40-
return 'sub::support';
41-
}
42-
43-
if (priceIds.has(process.env.STRIPE_GROWTH_PLAN_PRICE_ID)) {
44-
return 'sub::growth';
45-
}
46-
47-
if (priceIds.has(process.env.STRIPE_RIDICULOUSLY_CHEAP_PLAN_PRICE_ID)) {
48-
return 'sub::ridiculous';
49-
}
50-
5135
if (priceIds.has(process.env.STRIPE_FREE_PLAN_PRICE_ID)) {
5236
return 'sub::free';
5337
}

apps/event-system/services/users/users.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ module.exports = {
144144
'username',
145145
'userKey',
146146
'billing',
147+
'accessList',
147148
],
148149

149150
actions: {
@@ -868,6 +869,7 @@ module.exports = {
868869
}: any) {
869870
const updateUser = async (_user: any) => {
870871
const profile = get(_user, 'profile');
872+
const accessList = get(_user, 'accessList');
871873
const _firstName = get(_user, 'firstName')
872874
? get(_user, 'firstName')
873875
: firstName;
@@ -907,6 +909,7 @@ module.exports = {
907909
id: _user._id,
908910
firstName: _firstName,
909911
lastName: _lastName,
912+
accessList,
910913
username: _user.username ? _user.username : username,
911914
userKey: _user.userKey
912915
? _user.userKey
@@ -988,6 +991,7 @@ module.exports = {
988991
_user = await ctx.broker.call('v3.users.create', {
989992
email,
990993
username,
994+
accessList: [],
991995
userKey: `${username || email.substring(0, email.indexOf('@'))
992996
}${randomCode(6)}`,
993997
providers: {

libs-private/constants/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export const MAXIMUM_SECRET_KEYS_LIMIT = 1000;
2-
export const INTEGRATIONOS_VERSION = 'v1';
2+
export const PICA_VERSION = 'v1';

libs-private/data-models/types/ids.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const idPrefixes = {
1010
linkToken: 'ln_tk',
1111
setting: 'st',
1212
token: 'embed_tk',
13+
earlyAccess: 'ea',
1314
} as const;
1415

1516
export type IdPrefix = (typeof idPrefixes)[keyof typeof idPrefixes];

0 commit comments

Comments
 (0)