package-installer-cli 1.3.2 → 1.4.0
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.
- checksums.yaml +4 -4
- data/dist/commands/email.js +1140 -0
- data/dist/email-templates/bugReport.js +108 -0
- data/dist/email-templates/collectors/bugReport.js +41 -0
- data/dist/email-templates/collectors/common.js +56 -0
- data/dist/email-templates/collectors/docs.js +41 -0
- data/dist/email-templates/collectors/featureRequest.js +47 -0
- data/dist/email-templates/collectors/improvement.js +52 -0
- data/dist/email-templates/collectors/index.js +8 -0
- data/dist/email-templates/collectors/question.js +31 -0
- data/dist/email-templates/collectors/templateRequest.js +53 -0
- data/dist/email-templates/docs.js +111 -0
- data/dist/email-templates/featureRequest.js +111 -0
- data/dist/email-templates/generator.js +62 -0
- data/dist/email-templates/improvement.js +121 -0
- data/dist/email-templates/index.js +14 -0
- data/dist/email-templates/question.js +101 -0
- data/dist/email-templates/styles.js +168 -0
- data/dist/email-templates/templateRequest.js +120 -0
- data/dist/email-templates/testEmail.js +56 -0
- data/dist/email-templates/types.js +1 -0
- data/dist/index.js +29 -1
- data/dist/utils/featureInstaller.js +4 -11
- data/features/ai/ai.json +547 -0
- data/features/analytics/analytics.json +4 -0
- data/features/auth/auth.json +473 -0
- data/features/auth/auth0/django/backend/apiexample/urls.py +10 -0
- data/features/auth/auth0/django/backend/apiexample/validator.py +21 -0
- data/features/auth/auth0/django/backend/apiexample/views.py +30 -0
- data/features/auth/auth0/django/backend/requirements.txt +4 -0
- data/features/auth/auth0/django/web-app/requirements.txt +4 -0
- data/features/auth/auth0/django/web-app/webappexample/settings.py +28 -0
- data/features/auth/auth0/django/web-app/webappexample/templates/index.html +16 -0
- data/features/auth/auth0/django/web-app/webappexample/urls.py +10 -0
- data/features/auth/auth0/django/web-app/webappexample/views.py +52 -0
- data/features/auth/auth0/go/backend/go.mod +8 -0
- data/features/auth/auth0/go/backend/main.go +60 -0
- data/features/auth/auth0/go/backend/middleware/jwt.go +81 -0
- data/features/auth/auth0/go/web-app/auth.go +56 -0
- data/features/auth/auth0/go/web-app/callback.go +52 -0
- data/features/auth/auth0/go/web-app/go.mod +11 -0
- data/features/auth/auth0/go/web-app/isAuthenticated.go +20 -0
- data/features/auth/auth0/go/web-app/login.go +47 -0
- data/features/auth/auth0/go/web-app/logout.go +38 -0
- data/features/auth/auth0/go/web-app/main.go +31 -0
- data/features/auth/auth0/go/web-app/router.go +44 -0
- data/features/auth/auth0/go/web-app/user.go +18 -0
- data/features/auth/auth0/ruby-on-rails/backend/Gemfile +1 -0
- data/features/auth/auth0/ruby-on-rails/backend/app/controllers/application_controller.rb +5 -0
- data/features/auth/auth0/ruby-on-rails/backend/app/controllers/concern/secured.rb +60 -0
- data/features/auth/auth0/ruby-on-rails/backend/app/controllers/private_controller.rb +6 -0
- data/features/auth/auth0/ruby-on-rails/backend/app/controllers/public-controller.rb +6 -0
- data/features/auth/auth0/ruby-on-rails/backend/app/lib/auth0_client.rb +59 -0
- data/features/auth/auth0/ruby-on-rails/web-app/Gemfile +2 -0
- data/features/auth/auth0/ruby-on-rails/web-app/auth0_controller.rb +41 -0
- data/features/auth/auth0/ruby-on-rails/web-app/config/auth0.yml +4 -0
- data/features/auth/auth0/ruby-on-rails/web-app/config/initializers/auth0.rb +14 -0
- data/features/auth/auth0/ruby-on-rails/web-app/config/routes.rb +6 -0
- data/features/auth/auth0/ruby-on-rails/web-app/config/secured.rb +11 -0
- data/features/auth/clerk/go/clerk_client.go +28 -0
- data/features/auth/clerk/go/go.mod +5 -0
- data/features/auth/clerk/go/main.go +82 -0
- data/features/auth/clerk/nextjs/typescript/app/layout.tsx +2 -2
- data/features/auth/clerk/ruby-on-rails/Gemfile +1 -0
- data/features/auth/clerk/ruby-on-rails/app.rb +50 -0
- data/features/auth/clerk/ruby-on-rails/config/initializers/clerk.rb +4 -0
- data/features/aws/aws.json +5207 -0
- data/features/database/database.json +246 -0
- data/features/docker/docker.json +108 -0
- data/features/features.json +44 -7321
- data/features/gitignore/gitignore.json +61 -0
- data/features/monitoring/monitoring.json +5 -0
- data/features/payment/payment.json +347 -0
- data/features/storage/storage.json +371 -0
- data/features/testing/jest/angularjs/typescript/tests/angularjs.test.ts +12 -0
- data/features/testing/jest/expressjs/javascript/tests/expressjs.test.js +10 -0
- data/features/testing/jest/expressjs/typescript/tests/expressjs.test.ts +10 -0
- data/features/testing/jest/nestjs/typescript/tests/nestjs.test.ts +10 -0
- data/features/testing/jest/nextjs/javascript/tests/nextjs.test.js +10 -0
- data/features/testing/jest/nextjs/typescript/tests/nextjs.test.ts +10 -0
- data/features/testing/jest/nuxtjs/typescript/tests/nuxtjs.test.ts +9 -0
- data/features/testing/jest/reactjs/javascript/tests/reactjs.test.js +10 -0
- data/features/testing/jest/reactjs/typescript/tests/reactjs.test.ts +10 -0
- data/features/testing/jest/reactjs-expressjs-shadcn/javascript/tests/reactjs.expressjs.shadcn.test.js +16 -0
- data/features/testing/jest/reactjs-expressjs-shadcn/typescript/tests/reactjs.expressjs.shadcn.test.ts +16 -0
- data/features/testing/jest/reactjs-nestjs-shadcn/typescript/tests/reactjs.nestjs.shadcn.test.ts +14 -0
- data/features/testing/jest/remixjs/typescript/tests/remixjs.test.ts +9 -0
- data/features/testing/jest/vuejs/javascript/tests/vuejs.test.ts +9 -0
- data/features/testing/jest/vuejs/typescript/tests/vuejs.test.ts +9 -0
- data/features/testing/testing.json +102 -0
- data/features/ui/ui.json +91 -0
- metadata +88 -8
- data/features/testing/jest/angularjs/tests/angularjs.test.js +0 -12
- data/features/testing/jest/expressjs/tests/javascript/expressjs.test.js +0 -12
- data/features/testing/jest/expressjs/tests/typescript/expressjs.test.ts +0 -12
- data/features/testing/jest/go/tests/go.test.js +0 -12
- data/features/testing/jest/nextjs/tests/javascript/nextjs.test.js +0 -12
- data/features/testing/jest/nextjs/tests/typescript/nextjs.test.ts +0 -12
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package main
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"context"
|
|
5
|
+
"os"
|
|
6
|
+
|
|
7
|
+
"github.com/clerk/clerk-sdk-go/v2"
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
var clerkClient *clerk.Client
|
|
11
|
+
|
|
12
|
+
func initClerk() error {
|
|
13
|
+
secretKey := os.Getenv("CLERK_SECRET_KEY")
|
|
14
|
+
if secretKey == "" {
|
|
15
|
+
return fmt.Errorf("CLERK_SECRET_KEY not set")
|
|
16
|
+
}
|
|
17
|
+
client, err := clerk.NewClient(secretKey)
|
|
18
|
+
if err != nil {
|
|
19
|
+
return err
|
|
20
|
+
}
|
|
21
|
+
clerkClient = client
|
|
22
|
+
return nil
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Use this to get the client in other parts
|
|
26
|
+
func getClerkClient() *clerk.Client {
|
|
27
|
+
return clerkClient
|
|
28
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
package main
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"context"
|
|
5
|
+
"fmt"
|
|
6
|
+
"log"
|
|
7
|
+
"net/http"
|
|
8
|
+
|
|
9
|
+
"github.com/clerk/clerk-sdk-go/v2"
|
|
10
|
+
clerkhttp "github.com/clerk/clerk-sdk-go/v2/http"
|
|
11
|
+
"github.com/clerk/clerk-sdk-go/v2/organization"
|
|
12
|
+
"github.com/clerk/clerk-sdk-go/v2/organizationmembership"
|
|
13
|
+
"github.com/clerk/clerk-sdk-go/v2/user"
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
func main() {
|
|
17
|
+
// initialize Clerk
|
|
18
|
+
if err := initClerk(); err != nil {
|
|
19
|
+
log.Fatalf("failed to init Clerk: %v", err)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
ctx := context.Background()
|
|
23
|
+
|
|
24
|
+
// Example: create an organization
|
|
25
|
+
org, err := organization.Create(ctx, &organization.CreateParams{
|
|
26
|
+
Name: clerk.String("My Org Name"),
|
|
27
|
+
})
|
|
28
|
+
if err != nil {
|
|
29
|
+
log.Fatalf("organization create failed: %v", err)
|
|
30
|
+
}
|
|
31
|
+
fmt.Printf("Created organization: %+v\n", org)
|
|
32
|
+
|
|
33
|
+
// Update organization slug
|
|
34
|
+
updated, err := organization.Update(ctx, org.ID, &organization.UpdateParams{
|
|
35
|
+
Slug: clerk.String("my-org-slug"),
|
|
36
|
+
})
|
|
37
|
+
if err != nil {
|
|
38
|
+
log.Fatalf("organization update failed: %v", err)
|
|
39
|
+
}
|
|
40
|
+
fmt.Printf("Updated org slug: %+v\n", updated)
|
|
41
|
+
|
|
42
|
+
// List org memberships
|
|
43
|
+
listParams := organizationmembership.ListParams{
|
|
44
|
+
Limit: clerk.Int64(10),
|
|
45
|
+
}
|
|
46
|
+
memberships, err := organizationmembership.List(ctx, &listParams)
|
|
47
|
+
if err != nil {
|
|
48
|
+
log.Fatalf("list memberships failed: %v", err)
|
|
49
|
+
}
|
|
50
|
+
if len(memberships) > 0 {
|
|
51
|
+
m := memberships[0]
|
|
52
|
+
// fetch user details
|
|
53
|
+
usr, err := user.Get(ctx, m.UserID)
|
|
54
|
+
if err != nil {
|
|
55
|
+
log.Fatalf("user.Get failed: %v", err)
|
|
56
|
+
}
|
|
57
|
+
fmt.Printf("User from membership: %+v\n", usr)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// HTTP server with a protected endpoint
|
|
61
|
+
mux := http.NewServeMux()
|
|
62
|
+
mux.HandleFunc("/public", func(w http.ResponseWriter, r *http.Request) {
|
|
63
|
+
w.Write([]byte("This is public"))
|
|
64
|
+
})
|
|
65
|
+
// Protected route
|
|
66
|
+
protected := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
67
|
+
claims, ok := clerk.SessionClaimsFromContext(r.Context())
|
|
68
|
+
if !ok {
|
|
69
|
+
w.WriteHeader(http.StatusUnauthorized)
|
|
70
|
+
w.Write([]byte("No valid session"))
|
|
71
|
+
return
|
|
72
|
+
}
|
|
73
|
+
w.Write([]byte(fmt.Sprintf("Hello user %s", claims.Subject)))
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
// Wrap with authorization middleware (checks header bearer token)
|
|
77
|
+
mux.Handle("/protected", clerkhttp.RequireHeaderAuthorization()(protected))
|
|
78
|
+
|
|
79
|
+
addr := ":8080"
|
|
80
|
+
fmt.Printf("Starting server at %s\n", addr)
|
|
81
|
+
http.ListenAndServe(addr, mux)
|
|
82
|
+
}
|
|
@@ -21,8 +21,8 @@ const geistMono = Geist_Mono({
|
|
|
21
21
|
})
|
|
22
22
|
|
|
23
23
|
export const metadata: Metadata = {
|
|
24
|
-
title:
|
|
25
|
-
description:
|
|
24
|
+
title: "Clerk Authentication",
|
|
25
|
+
description: "Generated by PACKAGE INSTALLER CLI",
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export default function RootLayout({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gem 'clerk-sdk-ruby', require: "clerk"
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
require "clerk"
|
|
2
|
+
|
|
3
|
+
# make sure config setup code has run (see previous step)
|
|
4
|
+
|
|
5
|
+
sdk = Clerk::SDK.new
|
|
6
|
+
|
|
7
|
+
# Create a user
|
|
8
|
+
create_user_request = Clerk::SDK::CreateUserRequest.new(
|
|
9
|
+
first_name: "John",
|
|
10
|
+
last_name: "Doe",
|
|
11
|
+
email_address: ["john.doe@example.com"],
|
|
12
|
+
password: "password"
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
user = sdk.users.create(create_user_request)
|
|
16
|
+
|
|
17
|
+
# List users
|
|
18
|
+
user_list = sdk.users.get_user_list(limit: 1)
|
|
19
|
+
first_user = user_list.first
|
|
20
|
+
|
|
21
|
+
# Lock that user
|
|
22
|
+
sdk.users.lock_user(first_user["id"])
|
|
23
|
+
|
|
24
|
+
# Unlock the user
|
|
25
|
+
sdk.users.unlock_user(first_user["id"])
|
|
26
|
+
|
|
27
|
+
require_relative "clerk_setup"
|
|
28
|
+
require "clerk"
|
|
29
|
+
|
|
30
|
+
sdk = Clerk::SDK.new
|
|
31
|
+
|
|
32
|
+
create_user_req = Clerk::SDK::CreateUserRequest.new(
|
|
33
|
+
first_name: "Alice",
|
|
34
|
+
last_name: "Smith",
|
|
35
|
+
email_address: ["alice@example.com"],
|
|
36
|
+
password: "securepassword"
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
user = sdk.users.create(create_user_req)
|
|
40
|
+
puts "Created user: #{user}"
|
|
41
|
+
|
|
42
|
+
users = sdk.users.get_user_list(limit: 5)
|
|
43
|
+
puts "User list: #{users}"
|
|
44
|
+
|
|
45
|
+
if (u = users.first)
|
|
46
|
+
sdk.users.lock_user(u["id"])
|
|
47
|
+
puts "Locked user #{u['id']}"
|
|
48
|
+
sdk.users.unlock_user(u["id"])
|
|
49
|
+
puts "Unlocked user #{u['id']}"
|
|
50
|
+
end
|