@nativesquare/upwork 0.1.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.
- package/LICENSE +201 -0
- package/README.md +160 -0
- package/dist/client/_generated/_ignore.d.ts +1 -0
- package/dist/client/_generated/_ignore.d.ts.map +1 -0
- package/dist/client/_generated/_ignore.js +3 -0
- package/dist/client/_generated/_ignore.js.map +1 -0
- package/dist/client/index.d.ts +40 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +82 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/types.d.ts +34 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +3 -0
- package/dist/client/types.js.map +1 -0
- package/dist/component/_generated/api.d.ts +38 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +31 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/component.d.ts +84 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +121 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +78 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/convex.config.d.ts +3 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +3 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/crons.d.ts +3 -0
- package/dist/component/crons.d.ts.map +1 -0
- package/dist/component/crons.js +6 -0
- package/dist/component/crons.js.map +1 -0
- package/dist/component/private.d.ts +36 -0
- package/dist/component/private.d.ts.map +1 -0
- package/dist/component/private.js +99 -0
- package/dist/component/private.js.map +1 -0
- package/dist/component/public.d.ts +68 -0
- package/dist/component/public.d.ts.map +1 -0
- package/dist/component/public.js +241 -0
- package/dist/component/public.js.map +1 -0
- package/dist/component/schema.d.ts +59 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +30 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +6 -0
- package/dist/react/index.js.map +1 -0
- package/package.json +108 -0
- package/src/client/_generated/_ignore.ts +1 -0
- package/src/client/index.ts +131 -0
- package/src/client/types.ts +50 -0
- package/src/component/_generated/api.ts +54 -0
- package/src/component/_generated/component.ts +121 -0
- package/src/component/_generated/dataModel.ts +60 -0
- package/src/component/_generated/server.ts +156 -0
- package/src/component/convex.config.ts +3 -0
- package/src/component/crons.ts +13 -0
- package/src/component/private.ts +108 -0
- package/src/component/public.ts +315 -0
- package/src/component/schema.ts +31 -0
- package/src/react/index.ts +7 -0
- package/src/test.ts +18 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Convex Component Template
|
|
2
|
+
|
|
3
|
+
This is a Convex component, ready to be published on npm.
|
|
4
|
+
|
|
5
|
+
To create your own component:
|
|
6
|
+
|
|
7
|
+
1. Write code in src/component for your component. Component-specific tables,
|
|
8
|
+
queries, mutations, and actions go here.
|
|
9
|
+
2. Write code in src/client for the Class that interfaces with the component.
|
|
10
|
+
This is the bridge your users will access to get information into and out of
|
|
11
|
+
your component
|
|
12
|
+
3. Write example usage in example/convex/example.ts.
|
|
13
|
+
4. Delete the text in this readme until `---` and flesh out the README.
|
|
14
|
+
5. Publish to npm with `pnpm run alpha` or `pnpm run release`.
|
|
15
|
+
|
|
16
|
+
To develop your component run a dev process in the example project:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
pnpm i
|
|
20
|
+
pnpm run dev
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`pnpm i` will do the install and an initial build. `pnpm run dev` will start a
|
|
24
|
+
file watcher to re-build the component, as well as the example project frontend
|
|
25
|
+
and backend, which does codegen and installs the component.
|
|
26
|
+
|
|
27
|
+
Modify the schema and index files in src/component/ to define your component.
|
|
28
|
+
|
|
29
|
+
Write a client for using this component in src/client/index.ts.
|
|
30
|
+
|
|
31
|
+
If you won't be adding frontend code (e.g. React components) to this component
|
|
32
|
+
you can delete "./react" references in package.json and "src/react/" directory.
|
|
33
|
+
If you will be adding frontend code, add a peer dependency on React in
|
|
34
|
+
package.json.
|
|
35
|
+
|
|
36
|
+
### Component Directory structure
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
.
|
|
40
|
+
├── README.md documentation of your component
|
|
41
|
+
├── package.json component name, version number, other metadata
|
|
42
|
+
├── pnpm-lock.yaml Components are like libraries, pnpm-lock.yaml
|
|
43
|
+
│ is .gitignored and ignored by consumers.
|
|
44
|
+
├── src
|
|
45
|
+
│ ├── component/
|
|
46
|
+
│ │ ├── _generated/ Files here are generated for the component.
|
|
47
|
+
│ │ ├── convex.config.ts Name your component here and use other components
|
|
48
|
+
│ │ ├── lib.ts Define functions here and in new files in this directory
|
|
49
|
+
│ │ └── schema.ts schema specific to this component
|
|
50
|
+
│ ├── client/
|
|
51
|
+
│ │ └── index.ts Code that needs to run in the app that uses the
|
|
52
|
+
│ │ component. Generally the app interacts directly with
|
|
53
|
+
│ │ the component's exposed API (src/component/*).
|
|
54
|
+
│ └── react/ Code intended to be used on the frontend goes here.
|
|
55
|
+
│ │ Your are free to delete this if this component
|
|
56
|
+
│ │ does not provide code.
|
|
57
|
+
│ └── index.ts
|
|
58
|
+
├── example/ example Convex app that uses this component
|
|
59
|
+
│ └── convex/
|
|
60
|
+
│ ├── _generated/ Files here are generated for the example app.
|
|
61
|
+
│ ├── convex.config.ts Imports and uses this component
|
|
62
|
+
│ ├── myFunctions.ts Functions that use the component
|
|
63
|
+
│ └── schema.ts Example app schema
|
|
64
|
+
└── dist/ Publishing artifacts will be created here.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
# My Convex Component
|
|
70
|
+
|
|
71
|
+
[](https://badge.fury.io/js/@nativesquare%2Fmy-component)
|
|
72
|
+
|
|
73
|
+
<!-- START: Include on https://convex.dev/components -->
|
|
74
|
+
|
|
75
|
+
- [ ] What is some compelling syntax as a hook?
|
|
76
|
+
- [ ] Why should you use this component?
|
|
77
|
+
- [ ] Links to docs / other resources?
|
|
78
|
+
|
|
79
|
+
Found a bug? Feature request?
|
|
80
|
+
[File it here](https://github.com/NativeSquare/my-component/issues).
|
|
81
|
+
|
|
82
|
+
## Installation
|
|
83
|
+
|
|
84
|
+
Create a `convex.config.ts` file in your app's `convex/` folder and install the
|
|
85
|
+
component by calling `use`:
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
// convex/convex.config.ts
|
|
89
|
+
import { defineApp } from "convex/server";
|
|
90
|
+
import myComponent from "@nativesquare/my-component/convex.config.js";
|
|
91
|
+
|
|
92
|
+
const app = defineApp();
|
|
93
|
+
app.use(myComponent);
|
|
94
|
+
|
|
95
|
+
export default app;
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Usage
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { components } from "./_generated/api";
|
|
102
|
+
|
|
103
|
+
export const doSomething = mutation({
|
|
104
|
+
args: { text: v.string() },
|
|
105
|
+
handler: async (ctx, args) => {
|
|
106
|
+
return await ctx.runMutation(components.myComponent.lib.doSomething, {
|
|
107
|
+
text: args.text,
|
|
108
|
+
});
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
See more example usage in [example.ts](./example/convex/example.ts).
|
|
114
|
+
|
|
115
|
+
### HTTP Routes
|
|
116
|
+
|
|
117
|
+
You can register HTTP routes for the component to expose HTTP endpoints:
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
import { httpRouter } from "convex/server";
|
|
121
|
+
import { registerRoutes } from "@nativesquare/my-component";
|
|
122
|
+
import { components } from "./_generated/api";
|
|
123
|
+
|
|
124
|
+
const http = httpRouter();
|
|
125
|
+
|
|
126
|
+
registerRoutes(http, components.myComponent, {
|
|
127
|
+
pathPrefix: "/my-component",
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
export default http;
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
See [http.ts](./example/convex/http.ts) for a complete example.
|
|
134
|
+
|
|
135
|
+
## Upwork API Compliance
|
|
136
|
+
|
|
137
|
+
This component caches job postings from the Upwork API to improve performance
|
|
138
|
+
and reduce API calls. Users of this component must comply with
|
|
139
|
+
[Upwork's API Terms of Use](https://www.upwork.com/legal#api):
|
|
140
|
+
|
|
141
|
+
- **24-hour caching limit**: Upwork does not allow storing API data for more
|
|
142
|
+
than 24 hours. This component handles this automatically by stamping each
|
|
143
|
+
cached record with a `cachedAt` timestamp and running an hourly cron job that
|
|
144
|
+
purges any records older than 23 hours.
|
|
145
|
+
|
|
146
|
+
- **Rate limiting**: The Upwork API enforces a rate limit of **300 requests per
|
|
147
|
+
minute per IP address**. Exceeding this limit will result in HTTP 429
|
|
148
|
+
"Too Many Requests" responses. The caching layer in this component helps you
|
|
149
|
+
stay within these limits -- cached data is served directly from the database
|
|
150
|
+
without hitting the Upwork API. Be mindful of how frequently you call
|
|
151
|
+
`searchJobPostings`, as each invocation makes a live API request.
|
|
152
|
+
|
|
153
|
+
<!-- END: Include on https://convex.dev/components -->
|
|
154
|
+
|
|
155
|
+
Run the example:
|
|
156
|
+
|
|
157
|
+
```sh
|
|
158
|
+
pnpm i
|
|
159
|
+
pnpm run dev
|
|
160
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=_ignore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_ignore.d.ts","sourceRoot":"","sources":["../../../src/client/_generated/_ignore.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_ignore.js","sourceRoot":"","sources":["../../../src/client/_generated/_ignore.ts"],"names":[],"mappings":";AAAA,kEAAkE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ComponentApi } from "../component/_generated/component.js";
|
|
2
|
+
import type { ActionCtx, QueryCtx, JobPosting, SearchResult, AuthStatus } from "./types.js";
|
|
3
|
+
import type { HttpRouter } from "convex/server";
|
|
4
|
+
export type UpworkComponent = ComponentApi;
|
|
5
|
+
export declare class Upwork {
|
|
6
|
+
component: UpworkComponent;
|
|
7
|
+
constructor(component: UpworkComponent);
|
|
8
|
+
getAuthorizationUrl(opts: {
|
|
9
|
+
clientId: string;
|
|
10
|
+
siteUrl: string;
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
}): string;
|
|
13
|
+
exchangeAuthCode(ctx: ActionCtx, opts: {
|
|
14
|
+
clientId: string;
|
|
15
|
+
clientSecret: string;
|
|
16
|
+
code: string;
|
|
17
|
+
siteUrl: string;
|
|
18
|
+
baseUrl?: string;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
searchJobPostings(ctx: ActionCtx, opts: {
|
|
21
|
+
clientId: string;
|
|
22
|
+
clientSecret: string;
|
|
23
|
+
searchQuery?: string;
|
|
24
|
+
sortField?: string;
|
|
25
|
+
baseUrl?: string;
|
|
26
|
+
}): Promise<SearchResult>;
|
|
27
|
+
listJobPostings(ctx: QueryCtx, opts?: {
|
|
28
|
+
limit?: number;
|
|
29
|
+
}): Promise<JobPosting[]>;
|
|
30
|
+
getAuthStatus(ctx: QueryCtx): Promise<AuthStatus>;
|
|
31
|
+
}
|
|
32
|
+
export declare function registerRoutes(http: HttpRouter, component: UpworkComponent, opts: {
|
|
33
|
+
clientId: string;
|
|
34
|
+
clientSecret: string;
|
|
35
|
+
baseUrl?: string;
|
|
36
|
+
onSuccess?: string;
|
|
37
|
+
}): void;
|
|
38
|
+
export { DEFAULT_BASE_URL, CALLBACK_PATH } from "./types.js";
|
|
39
|
+
export type { JobPosting, SearchResult, AuthStatus } from "./types.js";
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC;AAE3C,qBAAa,MAAM;IACE,SAAS,EAAE,eAAe;gBAA1B,SAAS,EAAE,eAAe;IAE7C,mBAAmB,CAAC,IAAI,EAAE;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,MAAM;IAWJ,gBAAgB,CACpB,GAAG,EAAE,SAAS,EACd,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GACA,OAAO,CAAC,IAAI,CAAC;IAWV,iBAAiB,CACrB,GAAG,EAAE,SAAS,EACd,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GACA,OAAO,CAAC,YAAY,CAAC;IAUlB,eAAe,CACnB,GAAG,EAAE,QAAQ,EACb,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GACxB,OAAO,CAAC,UAAU,EAAE,CAAC;IAMlB,aAAa,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAGxD;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,eAAe,EAC1B,IAAI,EAAE;IACJ,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,QAwCF;AAED,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC7D,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { DEFAULT_BASE_URL, CALLBACK_PATH } from "./types.js";
|
|
2
|
+
import { httpActionGeneric } from "convex/server";
|
|
3
|
+
export class Upwork {
|
|
4
|
+
component;
|
|
5
|
+
constructor(component) {
|
|
6
|
+
this.component = component;
|
|
7
|
+
}
|
|
8
|
+
getAuthorizationUrl(opts) {
|
|
9
|
+
const base = opts.baseUrl ?? DEFAULT_BASE_URL;
|
|
10
|
+
const redirectUri = `${opts.siteUrl}${CALLBACK_PATH}`;
|
|
11
|
+
const params = new URLSearchParams({
|
|
12
|
+
response_type: "code",
|
|
13
|
+
client_id: opts.clientId,
|
|
14
|
+
redirect_uri: redirectUri,
|
|
15
|
+
});
|
|
16
|
+
return `${base}/ab/account-security/oauth2/authorize?${params.toString()}`;
|
|
17
|
+
}
|
|
18
|
+
async exchangeAuthCode(ctx, opts) {
|
|
19
|
+
const redirectUri = `${opts.siteUrl}${CALLBACK_PATH}`;
|
|
20
|
+
await ctx.runAction(this.component.public.exchangeAuthCode, {
|
|
21
|
+
clientId: opts.clientId,
|
|
22
|
+
clientSecret: opts.clientSecret,
|
|
23
|
+
code: opts.code,
|
|
24
|
+
redirectUri,
|
|
25
|
+
baseUrl: opts.baseUrl ?? DEFAULT_BASE_URL,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
async searchJobPostings(ctx, opts) {
|
|
29
|
+
return await ctx.runAction(this.component.public.searchJobPostings, {
|
|
30
|
+
clientId: opts.clientId,
|
|
31
|
+
clientSecret: opts.clientSecret,
|
|
32
|
+
baseUrl: opts.baseUrl ?? DEFAULT_BASE_URL,
|
|
33
|
+
searchQuery: opts.searchQuery,
|
|
34
|
+
sortField: opts.sortField,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async listJobPostings(ctx, opts) {
|
|
38
|
+
return await ctx.runQuery(this.component.public.listJobPostings, {
|
|
39
|
+
limit: opts?.limit,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async getAuthStatus(ctx) {
|
|
43
|
+
return await ctx.runQuery(this.component.public.getAuthStatus, {});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export function registerRoutes(http, component, opts) {
|
|
47
|
+
const baseUrl = opts.baseUrl ?? DEFAULT_BASE_URL;
|
|
48
|
+
http.route({
|
|
49
|
+
path: CALLBACK_PATH,
|
|
50
|
+
method: "GET",
|
|
51
|
+
handler: httpActionGeneric(async (ctx, request) => {
|
|
52
|
+
const url = new URL(request.url);
|
|
53
|
+
const code = url.searchParams.get("code");
|
|
54
|
+
if (!code) {
|
|
55
|
+
return new Response("Missing authorization code", { status: 400 });
|
|
56
|
+
}
|
|
57
|
+
const redirectUri = `${url.origin}${url.pathname}`;
|
|
58
|
+
try {
|
|
59
|
+
await ctx.runAction(component.public.exchangeAuthCode, {
|
|
60
|
+
clientId: opts.clientId,
|
|
61
|
+
clientSecret: opts.clientSecret,
|
|
62
|
+
code,
|
|
63
|
+
redirectUri,
|
|
64
|
+
baseUrl,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
const message = error instanceof Error ? error.message : "Unknown error";
|
|
69
|
+
return new Response(`OAuth callback failed: ${message}`, { status: 500 });
|
|
70
|
+
}
|
|
71
|
+
if (opts.onSuccess) {
|
|
72
|
+
return new Response(null, {
|
|
73
|
+
status: 302,
|
|
74
|
+
headers: { Location: opts.onSuccess },
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return new Response("Successfully connected to Upwork!", { status: 200 });
|
|
78
|
+
}),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
export { DEFAULT_BASE_URL, CALLBACK_PATH } from "./types.js";
|
|
82
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { GenericActionCtx, GenericMutationCtx, GenericQueryCtx, GenericDataModel } from "convex/server";
|
|
2
|
+
export type QueryCtx = Pick<GenericQueryCtx<GenericDataModel>, "runQuery">;
|
|
3
|
+
export type MutationCtx = Pick<GenericMutationCtx<GenericDataModel>, "runQuery" | "runMutation">;
|
|
4
|
+
export type ActionCtx = Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation" | "runAction">;
|
|
5
|
+
export type JobPosting = {
|
|
6
|
+
_id: string;
|
|
7
|
+
_creationTime: number;
|
|
8
|
+
upworkId: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description: string;
|
|
11
|
+
category?: string;
|
|
12
|
+
subcategory?: string;
|
|
13
|
+
skills: Array<{
|
|
14
|
+
name: string;
|
|
15
|
+
}>;
|
|
16
|
+
experienceLevel: string;
|
|
17
|
+
duration?: string;
|
|
18
|
+
budgetAmount?: string;
|
|
19
|
+
budgetCurrency?: string;
|
|
20
|
+
createdDateTime: string;
|
|
21
|
+
publishedDateTime: string;
|
|
22
|
+
clientTotalHires?: number;
|
|
23
|
+
clientCompanyName?: string;
|
|
24
|
+
cachedAt: number;
|
|
25
|
+
};
|
|
26
|
+
export type SearchResult = {
|
|
27
|
+
totalCount: number;
|
|
28
|
+
postings: Omit<JobPosting, "_id" | "_creationTime">[];
|
|
29
|
+
hasNextPage: boolean;
|
|
30
|
+
};
|
|
31
|
+
export type AuthStatus = "connected" | "disconnected" | "expired";
|
|
32
|
+
export declare const DEFAULT_BASE_URL = "https://upwork-mock-server.onrender.com";
|
|
33
|
+
export declare const CALLBACK_PATH = "/upwork/callback";
|
|
34
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,kBAAkB,CAAC,gBAAgB,CAAC,EACpC,UAAU,GAAG,aAAa,CAC3B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,IAAI,CAC1B,gBAAgB,CAAC,gBAAgB,CAAC,EAClC,UAAU,GAAG,aAAa,GAAG,WAAW,CACzC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,eAAe,CAAC,EAAE,CAAC;IACtD,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,cAAc,GAAG,SAAS,CAAC;AAElE,eAAO,MAAM,gBAAgB,4CAA4C,CAAC;AAE1E,eAAO,MAAM,aAAa,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":"AA+CA,MAAM,CAAC,MAAM,gBAAgB,GAAG,yCAAyC,CAAC;AAE1E,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated `api` utility.
|
|
3
|
+
*
|
|
4
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
+
*
|
|
6
|
+
* To regenerate, run `npx convex dev`.
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import type * as crons from "../crons.js";
|
|
10
|
+
import type * as private_ from "../private.js";
|
|
11
|
+
import type * as public_ from "../public.js";
|
|
12
|
+
import type { ApiFromModules, FilterApi, FunctionReference } from "convex/server";
|
|
13
|
+
declare const fullApi: ApiFromModules<{
|
|
14
|
+
crons: typeof crons;
|
|
15
|
+
private: typeof private_;
|
|
16
|
+
public: typeof public_;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* A utility for referencing Convex functions in your app's public API.
|
|
20
|
+
*
|
|
21
|
+
* Usage:
|
|
22
|
+
* ```js
|
|
23
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const api: FilterApi<typeof fullApi, FunctionReference<any, "public">>;
|
|
27
|
+
/**
|
|
28
|
+
* A utility for referencing Convex functions in your app's internal API.
|
|
29
|
+
*
|
|
30
|
+
* Usage:
|
|
31
|
+
* ```js
|
|
32
|
+
* const myFunctionReference = internal.myModule.myFunction;
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare const internal: FilterApi<typeof fullApi, FunctionReference<any, "internal">>;
|
|
36
|
+
export declare const components: {};
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,KAAK,OAAO,MAAM,cAAc,CAAC;AAE7C,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAGvB,QAAA,MAAM,OAAO,EAAE,cAAc,CAAC;IAC5B,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,OAAO,EAAE,OAAO,QAAQ,CAAC;IACzB,MAAM,EAAE,OAAO,OAAO,CAAC;CACxB,CAAiB,CAAC;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAE,SAAS,CACzB,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CACjB,CAAC;AAElB;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAC9B,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CACnB,CAAC;AAElB,eAAO,MAAM,UAAU,EAAqC,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated `api` utility.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { anyApi, componentsGeneric } from "convex/server";
|
|
11
|
+
const fullApi = anyApi;
|
|
12
|
+
/**
|
|
13
|
+
* A utility for referencing Convex functions in your app's public API.
|
|
14
|
+
*
|
|
15
|
+
* Usage:
|
|
16
|
+
* ```js
|
|
17
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export const api = anyApi;
|
|
21
|
+
/**
|
|
22
|
+
* A utility for referencing Convex functions in your app's internal API.
|
|
23
|
+
*
|
|
24
|
+
* Usage:
|
|
25
|
+
* ```js
|
|
26
|
+
* const myFunctionReference = internal.myModule.myFunction;
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export const internal = anyApi;
|
|
30
|
+
export const components = componentsGeneric();
|
|
31
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAWH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,OAAO,GAIR,MAAa,CAAC;AAEnB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,GAAG,GAGZ,MAAa,CAAC;AAElB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAGjB,MAAa,CAAC;AAElB,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,EAAmB,CAAC"}
|