@virjay/playscope-cocos 0.0.0-stage → 0.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/CHANGELOG.md +30 -0
- package/README.md +314 -2
- package/USAGE.md +372 -0
- package/VALIDATION.md +93 -0
- package/dist/adapters/levelplay/index.d.ts +15 -0
- package/dist/adapters/levelplay/index.js +14 -0
- package/dist/cocos/Storage.d.ts +16 -0
- package/dist/cocos/Storage.js +16 -0
- package/dist/cocos/XhrJsonTransport.d.ts +8 -0
- package/dist/cocos/XhrJsonTransport.js +65 -0
- package/dist/cocos/index.d.ts +48 -0
- package/dist/cocos/index.js +134 -0
- package/dist/core/ClientOwnership.d.ts +6 -0
- package/dist/core/ClientOwnership.js +39 -0
- package/dist/core/ClientScope.d.ts +5 -0
- package/dist/core/ClientScope.js +34 -0
- package/dist/core/ConfigurationSync.d.ts +18 -0
- package/dist/core/ConfigurationSync.js +66 -0
- package/dist/core/FactEncoding.d.ts +10 -0
- package/dist/core/FactEncoding.js +29 -0
- package/dist/core/HttpError.d.ts +10 -0
- package/dist/core/HttpError.js +17 -0
- package/dist/core/OutboxStore.d.ts +31 -0
- package/dist/core/OutboxStore.js +228 -0
- package/dist/core/PersistentState.d.ts +33 -0
- package/dist/core/PersistentState.js +92 -0
- package/dist/core/PlayScopeClient.d.ts +65 -0
- package/dist/core/PlayScopeClient.js +422 -0
- package/dist/core/QueueAdmission.d.ts +4 -0
- package/dist/core/QueueAdmission.js +29 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.js +27 -0
- package/dist/core/revenue.d.ts +33 -0
- package/dist/core/revenue.js +23 -0
- package/dist/core/types.d.ts +155 -0
- package/dist/core/types.js +2 -0
- package/dist/core/uuid.d.ts +1 -0
- package/dist/core/uuid.js +9 -0
- package/dist/esm/adapters/levelplay/index.js +11 -0
- package/dist/esm/cocos/Storage.js +12 -0
- package/dist/esm/cocos/XhrJsonTransport.js +61 -0
- package/dist/esm/cocos/index.js +115 -0
- package/dist/esm/core/ClientOwnership.js +34 -0
- package/dist/esm/core/ClientScope.js +30 -0
- package/dist/esm/core/ConfigurationSync.js +62 -0
- package/dist/esm/core/FactEncoding.js +24 -0
- package/dist/esm/core/HttpError.js +12 -0
- package/dist/esm/core/OutboxStore.js +224 -0
- package/dist/esm/core/PersistentState.js +85 -0
- package/dist/esm/core/PlayScopeClient.js +415 -0
- package/dist/esm/core/QueueAdmission.js +25 -0
- package/dist/esm/core/index.js +7 -0
- package/dist/esm/core/revenue.js +20 -0
- package/dist/esm/core/types.js +1 -0
- package/dist/esm/core/uuid.js +6 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/protocols/game-v1/index.js +21 -0
- package/dist/protocols/game-v1/index.d.ts +8 -0
- package/dist/protocols/game-v1/index.js +25 -0
- package/doc/README.md +4 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227/README.md +585 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231/0.1.1-types/adapters/levelplay/index.d.ts +15 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231/0.1.1-types/cocos/Storage.d.ts +13 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231/0.1.1-types/cocos/XhrJsonTransport.d.ts +8 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231/0.1.1-types/cocos/index.d.ts +38 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231/0.1.1-types/core/PlayScopeClient.d.ts +46 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231/0.1.1-types/core/index.d.ts +3 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231/0.1.1-types/core/revenue.d.ts +25 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231/0.1.1-types/core/types.d.ts +81 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231/exports.json +89 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231/public-api.d.ts +281 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231//346/234/215/345/212/241/347/253/257/client-context.schema.json +103 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231//346/234/215/345/212/241/347/253/257/game-ad-properties.json +765 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231//346/234/215/345/212/241/347/253/257/game-builtin-properties.json +479 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231//346/234/215/345/212/241/347/253/257/game-event.json +278 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231//346/234/215/345/212/241/347/253/257/product-events.json +2878 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231//346/234/215/345/212/241/347/253/257/standard-contract.json +183 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231//346/234/215/345/212/241/347/253/257//344/272/247/345/223/201/344/272/213/344/273/266/347/264/242/345/274/225.md +87 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//345/217/202/350/200/203/350/265/204/346/226/231//346/235/245/346/272/220/344/270/216/347/211/210/346/234/254.json +35 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//347/244/272/344/276/213/CoreIntegration.ts +13 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//347/244/272/344/276/213/LevelPlayTelemetry.ts +119 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//347/244/272/344/276/213/PlayScopeExample.ts +46 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//347/244/272/344/276/213/QuestGarden.ts +129 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//347/244/272/344/276/213/README.md +23 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//347/244/272/344/276/213/project-fixture.json +188 -0
- package/doc//344/275/277/347/224/250/346/214/207/345/215/227//347/244/272/344/276/213/tsconfig.json +20 -0
- package/examples/cocos-minimal/PlayScopeExample.ts +27 -0
- package/examples/quest-garden/QuestGarden.ts +129 -0
- package/examples/quest-garden/README.md +180 -0
- package/examples/quest-garden/project-fixture.json +188 -0
- package/examples/quest-garden/tsconfig.json +12 -0
- package/package.json +73 -4
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"required": [
|
|
5
|
+
"eventVersion",
|
|
6
|
+
"eventId",
|
|
7
|
+
"name",
|
|
8
|
+
"occurredAt",
|
|
9
|
+
"sessionId",
|
|
10
|
+
"sequence",
|
|
11
|
+
"client",
|
|
12
|
+
"samplingProbability",
|
|
13
|
+
"run",
|
|
14
|
+
"properties"
|
|
15
|
+
],
|
|
16
|
+
"properties": {
|
|
17
|
+
"eventVersion": {
|
|
18
|
+
"type": "integer",
|
|
19
|
+
"minimum": 1,
|
|
20
|
+
"maximum": 1000
|
|
21
|
+
},
|
|
22
|
+
"eventId": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"format": "uuid"
|
|
25
|
+
},
|
|
26
|
+
"name": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"pattern": "^[a-z][a-z0-9_]{0,63}$"
|
|
29
|
+
},
|
|
30
|
+
"occurredAt": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"format": "date-time"
|
|
33
|
+
},
|
|
34
|
+
"sessionId": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"format": "uuid"
|
|
37
|
+
},
|
|
38
|
+
"sequence": {
|
|
39
|
+
"type": "integer",
|
|
40
|
+
"minimum": 1,
|
|
41
|
+
"maximum": 9007199254740991
|
|
42
|
+
},
|
|
43
|
+
"client": {
|
|
44
|
+
"$ref": "#/$defs/ClientContext"
|
|
45
|
+
},
|
|
46
|
+
"samplingProbability": {
|
|
47
|
+
"const": 1
|
|
48
|
+
},
|
|
49
|
+
"run": {
|
|
50
|
+
"anyOf": [
|
|
51
|
+
{
|
|
52
|
+
"type": "null"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"$ref": "#/$defs/Run"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"properties": {
|
|
60
|
+
"type": "object"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"$defs": {
|
|
65
|
+
"ClientContext": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"properties": {
|
|
68
|
+
"appVersion": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"maxLength": 256
|
|
71
|
+
},
|
|
72
|
+
"buildNumber": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"maxLength": 256
|
|
75
|
+
},
|
|
76
|
+
"platform": {
|
|
77
|
+
"anyOf": [
|
|
78
|
+
{
|
|
79
|
+
"type": "string",
|
|
80
|
+
"const": "android",
|
|
81
|
+
"maxLength": 256
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"type": "string",
|
|
85
|
+
"const": "ios",
|
|
86
|
+
"maxLength": 256
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"type": "string",
|
|
90
|
+
"const": "web",
|
|
91
|
+
"maxLength": 256
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"type": "string",
|
|
95
|
+
"const": "wechat",
|
|
96
|
+
"maxLength": 256
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"environment": {
|
|
101
|
+
"anyOf": [
|
|
102
|
+
{
|
|
103
|
+
"type": "string",
|
|
104
|
+
"const": "production",
|
|
105
|
+
"maxLength": 256
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"type": "string",
|
|
109
|
+
"const": "test",
|
|
110
|
+
"maxLength": 256
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"locale": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"maxLength": 256
|
|
117
|
+
},
|
|
118
|
+
"timezoneOffsetMinutes": {
|
|
119
|
+
"type": "integer",
|
|
120
|
+
"minimum": -840,
|
|
121
|
+
"maximum": 840
|
|
122
|
+
},
|
|
123
|
+
"device": {
|
|
124
|
+
"type": "object",
|
|
125
|
+
"properties": {
|
|
126
|
+
"type": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"const": "android_id",
|
|
129
|
+
"maxLength": 256
|
|
130
|
+
},
|
|
131
|
+
"id": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"pattern": "^[0-9a-f]{16}$",
|
|
134
|
+
"not": {
|
|
135
|
+
"enum": [
|
|
136
|
+
"0000000000000000",
|
|
137
|
+
"9774d56d682e549c"
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"required": [
|
|
143
|
+
"type",
|
|
144
|
+
"id"
|
|
145
|
+
],
|
|
146
|
+
"additionalProperties": false
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"required": [
|
|
150
|
+
"appVersion",
|
|
151
|
+
"buildNumber",
|
|
152
|
+
"platform",
|
|
153
|
+
"locale",
|
|
154
|
+
"timezoneOffsetMinutes"
|
|
155
|
+
],
|
|
156
|
+
"additionalProperties": false,
|
|
157
|
+
"dependentSchemas": {
|
|
158
|
+
"device": {
|
|
159
|
+
"properties": {
|
|
160
|
+
"platform": {
|
|
161
|
+
"const": "android"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"ConfigAttribution": {
|
|
168
|
+
"type": "object",
|
|
169
|
+
"properties": {
|
|
170
|
+
"configRevision": {
|
|
171
|
+
"type": "string",
|
|
172
|
+
"maxLength": 64,
|
|
173
|
+
"pattern": "^[a-zA-Z0-9._-]{1,64}$"
|
|
174
|
+
},
|
|
175
|
+
"source": {
|
|
176
|
+
"anyOf": [
|
|
177
|
+
{
|
|
178
|
+
"type": "string",
|
|
179
|
+
"const": "bundled",
|
|
180
|
+
"maxLength": 256
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"type": "string",
|
|
184
|
+
"const": "remote",
|
|
185
|
+
"maxLength": 256
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"type": "string",
|
|
189
|
+
"const": "cache",
|
|
190
|
+
"maxLength": 256
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
"assignmentId": {
|
|
195
|
+
"anyOf": [
|
|
196
|
+
{
|
|
197
|
+
"type": "null"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"type": "string",
|
|
201
|
+
"maxLength": 256
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
"experimentId": {
|
|
206
|
+
"anyOf": [
|
|
207
|
+
{
|
|
208
|
+
"type": "null"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"type": "string",
|
|
212
|
+
"maxLength": 256
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
"variantId": {
|
|
217
|
+
"anyOf": [
|
|
218
|
+
{
|
|
219
|
+
"type": "null"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"type": "string",
|
|
223
|
+
"maxLength": 256
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"required": [
|
|
229
|
+
"configRevision",
|
|
230
|
+
"source",
|
|
231
|
+
"assignmentId",
|
|
232
|
+
"experimentId",
|
|
233
|
+
"variantId"
|
|
234
|
+
],
|
|
235
|
+
"additionalProperties": false
|
|
236
|
+
},
|
|
237
|
+
"Run": {
|
|
238
|
+
"type": "object",
|
|
239
|
+
"required": [
|
|
240
|
+
"runId",
|
|
241
|
+
"mode",
|
|
242
|
+
"config"
|
|
243
|
+
],
|
|
244
|
+
"properties": {
|
|
245
|
+
"runId": {
|
|
246
|
+
"type": "string",
|
|
247
|
+
"format": "uuid"
|
|
248
|
+
},
|
|
249
|
+
"mode": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
"minLength": 1,
|
|
252
|
+
"maxLength": 128
|
|
253
|
+
},
|
|
254
|
+
"level": {
|
|
255
|
+
"anyOf": [
|
|
256
|
+
{
|
|
257
|
+
"type": "null"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"type": "string",
|
|
261
|
+
"minLength": 1,
|
|
262
|
+
"maxLength": 128
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"type": "integer",
|
|
266
|
+
"minimum": 0,
|
|
267
|
+
"maximum": 9007199254740991
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
"config": {
|
|
272
|
+
"$ref": "#/$defs/ConfigAttribution"
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"additionalProperties": false
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|