@laboratoria/sdk-js 0.1.1 → 1.2.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/README.md +40 -3
- package/index.js +12 -20
- package/lib/core.js +66 -11
- package/lib/curriculum.js +59 -0
- package/lib/model.js +107 -41
- package/package.json +21 -11
- package/schemas/core.json +211 -11
- package/index.spec.js +0 -112
- package/lib/client.spec.js +0 -77
- package/lib/currencies.js +0 -3
- package/lib/model.spec.js +0 -215
- package/lib/team.js +0 -52
- package/schemas/team.json +0 -146
package/lib/team.js
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
import { createModels, extendSchemaDefinitions } from './model';
|
2
|
-
import currencies from './currencies';
|
3
|
-
import roles from './roles';
|
4
|
-
import schema from '../schemas/team.json';
|
5
|
-
|
6
|
-
const extended = {
|
7
|
-
Country: {
|
8
|
-
plural: 'countries',
|
9
|
-
},
|
10
|
-
Contract: {
|
11
|
-
inputProps: [
|
12
|
-
'uid',
|
13
|
-
'countryCode',
|
14
|
-
'currency',
|
15
|
-
'isEmployment',
|
16
|
-
'feeBasis',
|
17
|
-
'feeAmount',
|
18
|
-
'hoursPerWeek',
|
19
|
-
'start',
|
20
|
-
'end',
|
21
|
-
],
|
22
|
-
properties: {
|
23
|
-
countryCode: {
|
24
|
-
enum: ['BR', 'CL', 'CO', 'MX', 'PE'],
|
25
|
-
},
|
26
|
-
currency: {
|
27
|
-
enum: currencies,
|
28
|
-
},
|
29
|
-
},
|
30
|
-
},
|
31
|
-
Gig: {
|
32
|
-
inputProps: [
|
33
|
-
// 'contract',
|
34
|
-
'cohortId',
|
35
|
-
'uid',
|
36
|
-
'role',
|
37
|
-
'hoursPerWeek',
|
38
|
-
'start',
|
39
|
-
'end',
|
40
|
-
],
|
41
|
-
properties: {
|
42
|
-
role: {
|
43
|
-
enum: roles,
|
44
|
-
},
|
45
|
-
},
|
46
|
-
},
|
47
|
-
};
|
48
|
-
|
49
|
-
export const createAPI = (url, state) => createModels(url, state, {
|
50
|
-
...schema,
|
51
|
-
definitions: extendSchemaDefinitions(schema, extended),
|
52
|
-
});
|
package/schemas/team.json
DELETED
@@ -1,146 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
3
|
-
"definitions": {
|
4
|
-
"Country": {
|
5
|
-
"type": "object",
|
6
|
-
"properties": {
|
7
|
-
"code": {
|
8
|
-
"type": "string"
|
9
|
-
},
|
10
|
-
"name": {
|
11
|
-
"type": "string"
|
12
|
-
},
|
13
|
-
"contracts": {
|
14
|
-
"type": "array",
|
15
|
-
"items": {
|
16
|
-
"$ref": "#/definitions/Contract"
|
17
|
-
}
|
18
|
-
}
|
19
|
-
}
|
20
|
-
},
|
21
|
-
"Contract": {
|
22
|
-
"type": "object",
|
23
|
-
"properties": {
|
24
|
-
"id": {
|
25
|
-
"type": "integer"
|
26
|
-
},
|
27
|
-
"createdAt": {
|
28
|
-
"type": "string",
|
29
|
-
"format": "date-time"
|
30
|
-
},
|
31
|
-
"updatedAt": {
|
32
|
-
"type": "string",
|
33
|
-
"format": "date-time"
|
34
|
-
},
|
35
|
-
"createdBy": {
|
36
|
-
"type": "string"
|
37
|
-
},
|
38
|
-
"uid": {
|
39
|
-
"type": "string"
|
40
|
-
},
|
41
|
-
"isEmployment": {
|
42
|
-
"type": "boolean"
|
43
|
-
},
|
44
|
-
"currency": {
|
45
|
-
"type": "string"
|
46
|
-
},
|
47
|
-
"feeBasis": {
|
48
|
-
"type": "string",
|
49
|
-
"enum": [
|
50
|
-
"HOURLY",
|
51
|
-
"MONTHLY"
|
52
|
-
]
|
53
|
-
},
|
54
|
-
"feeAmount": {
|
55
|
-
"type": "integer"
|
56
|
-
},
|
57
|
-
"hoursPerWeek": {
|
58
|
-
"type": "integer"
|
59
|
-
},
|
60
|
-
"start": {
|
61
|
-
"type": "string",
|
62
|
-
"format": "date-time"
|
63
|
-
},
|
64
|
-
"end": {
|
65
|
-
"type": [
|
66
|
-
"string",
|
67
|
-
"null"
|
68
|
-
],
|
69
|
-
"format": "date-time"
|
70
|
-
},
|
71
|
-
"country": {
|
72
|
-
"$ref": "#/definitions/Country"
|
73
|
-
},
|
74
|
-
"gigs": {
|
75
|
-
"type": "array",
|
76
|
-
"items": {
|
77
|
-
"$ref": "#/definitions/Gig"
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
81
|
-
},
|
82
|
-
"Gig": {
|
83
|
-
"type": "object",
|
84
|
-
"properties": {
|
85
|
-
"id": {
|
86
|
-
"type": "integer"
|
87
|
-
},
|
88
|
-
"createdAt": {
|
89
|
-
"type": "string",
|
90
|
-
"format": "date-time"
|
91
|
-
},
|
92
|
-
"updatedAt": {
|
93
|
-
"type": "string",
|
94
|
-
"format": "date-time"
|
95
|
-
},
|
96
|
-
"createdBy": {
|
97
|
-
"type": "string"
|
98
|
-
},
|
99
|
-
"role": {
|
100
|
-
"type": "string",
|
101
|
-
"enum": [
|
102
|
-
"bm",
|
103
|
-
"pdc",
|
104
|
-
"js",
|
105
|
-
"ux"
|
106
|
-
]
|
107
|
-
},
|
108
|
-
"hoursPerWeek": {
|
109
|
-
"type": "integer"
|
110
|
-
},
|
111
|
-
"start": {
|
112
|
-
"type": "string",
|
113
|
-
"format": "date-time"
|
114
|
-
},
|
115
|
-
"end": {
|
116
|
-
"type": [
|
117
|
-
"string",
|
118
|
-
"null"
|
119
|
-
],
|
120
|
-
"format": "date-time"
|
121
|
-
},
|
122
|
-
"uid": {
|
123
|
-
"type": "string"
|
124
|
-
},
|
125
|
-
"cohortId": {
|
126
|
-
"type": "integer"
|
127
|
-
},
|
128
|
-
"contract": {
|
129
|
-
"$ref": "#/definitions/Contract"
|
130
|
-
}
|
131
|
-
}
|
132
|
-
}
|
133
|
-
},
|
134
|
-
"type": "object",
|
135
|
-
"properties": {
|
136
|
-
"country": {
|
137
|
-
"$ref": "#/definitions/Country"
|
138
|
-
},
|
139
|
-
"contract": {
|
140
|
-
"$ref": "#/definitions/Contract"
|
141
|
-
},
|
142
|
-
"gig": {
|
143
|
-
"$ref": "#/definitions/Gig"
|
144
|
-
}
|
145
|
-
}
|
146
|
-
}
|