spree_api 4.5.5 → 4.6.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/app/controllers/concerns/spree/api/v2/product_list_includes.rb +2 -1
- data/app/controllers/spree/api/v2/base_controller.rb +2 -0
- data/app/controllers/spree/api/v2/data_feeds/google_controller.rb +24 -0
- data/app/controllers/spree/api/v2/platform/data_feeds_controller.rb +15 -0
- data/app/controllers/spree/api/v2/resource_controller.rb +1 -1
- data/app/controllers/spree/api/v2/storefront/products_controller.rb +1 -1
- data/app/controllers/spree/api/v2/storefront/taxons_controller.rb +4 -3
- data/app/helpers/spree/api/v2/collection_options_helpers.rb +1 -1
- data/app/models/spree/webhooks/event.rb +8 -0
- data/app/models/spree/webhooks/event_signature.rb +33 -0
- data/app/models/spree/webhooks/subscriber.rb +2 -1
- data/app/serializers/spree/api/v2/platform/data_feed_serializer.rb +13 -0
- data/app/serializers/spree/api/v2/platform/user_serializer.rb +1 -1
- data/app/serializers/spree/v2/storefront/product_serializer.rb +4 -0
- data/app/serializers/spree/v2/storefront/taxon_serializer.rb +4 -0
- data/app/serializers/spree/v2/storefront/user_serializer.rb +1 -1
- data/app/services/spree/webhooks/subscribers/handle_request.rb +5 -1
- data/app/services/spree/webhooks/subscribers/make_request.rb +3 -2
- data/brakeman.ignore +7 -0
- data/config/routes.rb +8 -0
- data/db/migrate/20221221122100_add_secret_key_to_spree_webhooks_subscribers.rb +5 -0
- data/db/migrate/20230116204600_backfill_secret_key_for_spree_webhooks_subscribers.rb +5 -0
- data/db/migrate/20230116205000_change_secret_key_to_non_null_column.rb +5 -0
- data/docs/oauth/index.yml +5 -5
- data/docs/v2/platform/index.yaml +329 -1
- data/docs/v2/storefront/index.yaml +129 -105
- data/lib/spree/api/dependencies.rb +86 -129
- metadata +15 -7
data/docs/v2/platform/index.yaml
CHANGED
@@ -2200,6 +2200,282 @@ paths:
|
|
2200
2200
|
error: The access token is invalid
|
2201
2201
|
schema:
|
2202
2202
|
"$ref": "#/components/schemas/error"
|
2203
|
+
"/api/v2/platform/data_feeds":
|
2204
|
+
get:
|
2205
|
+
summary: Return a list of Data Feeds
|
2206
|
+
tags:
|
2207
|
+
- Data Feeds
|
2208
|
+
security:
|
2209
|
+
- bearer_auth: [ ]
|
2210
|
+
operationId: data-feeds-list
|
2211
|
+
parameters:
|
2212
|
+
- name: page
|
2213
|
+
in: query
|
2214
|
+
example: 1
|
2215
|
+
schema:
|
2216
|
+
type: integer
|
2217
|
+
- name: per_page
|
2218
|
+
in: query
|
2219
|
+
example: 50
|
2220
|
+
schema:
|
2221
|
+
type: integer
|
2222
|
+
responses:
|
2223
|
+
'200':
|
2224
|
+
description: Records returned
|
2225
|
+
content:
|
2226
|
+
application/vnd.api+json:
|
2227
|
+
examples:
|
2228
|
+
Example:
|
2229
|
+
value:
|
2230
|
+
data:
|
2231
|
+
- id: '1'
|
2232
|
+
type: data_feed
|
2233
|
+
attributes:
|
2234
|
+
name: First Data Feed
|
2235
|
+
type: Spree::DataFeed::Google
|
2236
|
+
slug: e593ae1f-630a-4f77-832f-0489da1c921b
|
2237
|
+
active: true
|
2238
|
+
- id: '2'
|
2239
|
+
type: data_feed
|
2240
|
+
attributes:
|
2241
|
+
name: Second Data Feed
|
2242
|
+
type: Spree::DataFeed::Google
|
2243
|
+
slug: 52f060f2-76cf-4983-89a3-714419941463
|
2244
|
+
active: true
|
2245
|
+
meta:
|
2246
|
+
count: 2
|
2247
|
+
total_count: 2
|
2248
|
+
total_pages: 1
|
2249
|
+
links:
|
2250
|
+
self: http://www.example.com/api/v2/platform/data_feeds?page=1&per_page=
|
2251
|
+
next: http://www.example.com/api/v2/platform/data_feeds?page=1&per_page=
|
2252
|
+
prev: http://www.example.com/api/v2/platform/data_feeds?page=1&per_page=
|
2253
|
+
last: http://www.example.com/api/v2/platform/data_feeds?page=1&per_page=
|
2254
|
+
first: http://www.example.com/api/v2/platform/data_feeds?page=1&per_page=
|
2255
|
+
schema:
|
2256
|
+
"$ref": "#/components/schemas/resources_list"
|
2257
|
+
'401':
|
2258
|
+
description: Authentication Failed
|
2259
|
+
content:
|
2260
|
+
application/vnd.api+json:
|
2261
|
+
examples:
|
2262
|
+
Example:
|
2263
|
+
value:
|
2264
|
+
error: The access token is invalid
|
2265
|
+
schema:
|
2266
|
+
"$ref": "#/components/schemas/error"
|
2267
|
+
post:
|
2268
|
+
summary: Create a Data Feed
|
2269
|
+
tags:
|
2270
|
+
- Data Feeds
|
2271
|
+
security:
|
2272
|
+
- bearer_auth: [ ]
|
2273
|
+
description: Creates a Data Feed
|
2274
|
+
operationId: create-data-feed
|
2275
|
+
parameters: [ ]
|
2276
|
+
responses:
|
2277
|
+
'201':
|
2278
|
+
description: Record created
|
2279
|
+
content:
|
2280
|
+
application/vnd.api+json:
|
2281
|
+
examples:
|
2282
|
+
Example:
|
2283
|
+
value:
|
2284
|
+
data:
|
2285
|
+
id: '1'
|
2286
|
+
type: data_feed
|
2287
|
+
attributes:
|
2288
|
+
name: First Data Feed
|
2289
|
+
type: Spree::DataFeed::Google
|
2290
|
+
slug: e593ae1f-630a-4f77-832f-0489da1c921b
|
2291
|
+
active: true
|
2292
|
+
schema:
|
2293
|
+
"$ref": "#/components/schemas/resource"
|
2294
|
+
'422':
|
2295
|
+
description: Invalid request
|
2296
|
+
content:
|
2297
|
+
application/vnd.api+json:
|
2298
|
+
examples:
|
2299
|
+
Example:
|
2300
|
+
value:
|
2301
|
+
error: Data Feed name can't be blank
|
2302
|
+
errors:
|
2303
|
+
name:
|
2304
|
+
- can't be blank
|
2305
|
+
type:
|
2306
|
+
- can't be blank
|
2307
|
+
schema:
|
2308
|
+
"$ref": "#/components/schemas/validation_errors"
|
2309
|
+
requestBody:
|
2310
|
+
content:
|
2311
|
+
application/json:
|
2312
|
+
schema:
|
2313
|
+
"$ref": "#/components/schemas/create_data_feed_params"
|
2314
|
+
"/api/v2/platform/data_feeds/{id}":
|
2315
|
+
get:
|
2316
|
+
summary: Return a Data Feed
|
2317
|
+
tags:
|
2318
|
+
- Data Feeds
|
2319
|
+
security:
|
2320
|
+
- bearer_auth: [ ]
|
2321
|
+
description: Returns a Data Feed
|
2322
|
+
operationId: show-data-feed
|
2323
|
+
parameters:
|
2324
|
+
- name: id
|
2325
|
+
in: path
|
2326
|
+
required: true
|
2327
|
+
schema:
|
2328
|
+
type: string
|
2329
|
+
responses:
|
2330
|
+
'200':
|
2331
|
+
description: Record found
|
2332
|
+
content:
|
2333
|
+
application/vnd.api+json:
|
2334
|
+
examples:
|
2335
|
+
Example:
|
2336
|
+
value:
|
2337
|
+
data:
|
2338
|
+
id: '1'
|
2339
|
+
type: data_feed
|
2340
|
+
attributes:
|
2341
|
+
name: First Data Feed
|
2342
|
+
type: Spree::DataFeed::Google
|
2343
|
+
slug: e593ae1f-630a-4f77-832f-0489da1c921b
|
2344
|
+
active: true
|
2345
|
+
relationships:
|
2346
|
+
store:
|
2347
|
+
data:
|
2348
|
+
id: '1'
|
2349
|
+
type: store
|
2350
|
+
schema:
|
2351
|
+
"$ref": "#/components/schemas/resource"
|
2352
|
+
'404':
|
2353
|
+
description: Record not found
|
2354
|
+
content:
|
2355
|
+
application/vnd.api+json:
|
2356
|
+
examples:
|
2357
|
+
Example:
|
2358
|
+
value:
|
2359
|
+
error: The resource you were looking for could not be found.
|
2360
|
+
schema:
|
2361
|
+
"$ref": "#/components/schemas/error"
|
2362
|
+
'401':
|
2363
|
+
description: Authentication Failed
|
2364
|
+
content:
|
2365
|
+
application/vnd.api+json:
|
2366
|
+
examples:
|
2367
|
+
Example:
|
2368
|
+
value:
|
2369
|
+
error: The access token is invalid
|
2370
|
+
schema:
|
2371
|
+
"$ref": "#/components/schemas/error"
|
2372
|
+
patch:
|
2373
|
+
summary: Update a Data Feed
|
2374
|
+
tags:
|
2375
|
+
- Data Feeds
|
2376
|
+
security:
|
2377
|
+
- bearer_auth: [ ]
|
2378
|
+
description: Updates a Data Feed
|
2379
|
+
operationId: update-data-feed
|
2380
|
+
parameters:
|
2381
|
+
- name: id
|
2382
|
+
in: path
|
2383
|
+
required: true
|
2384
|
+
schema:
|
2385
|
+
type: string
|
2386
|
+
responses:
|
2387
|
+
'200':
|
2388
|
+
description: Record updated
|
2389
|
+
content:
|
2390
|
+
application/vnd.api+json:
|
2391
|
+
examples:
|
2392
|
+
Example:
|
2393
|
+
value:
|
2394
|
+
data:
|
2395
|
+
id: '1'
|
2396
|
+
type: data_feed
|
2397
|
+
attributes:
|
2398
|
+
name: First Data Feed
|
2399
|
+
type: Spree::DataFeed::Google
|
2400
|
+
slug: e593ae1f-630a-4f77-832f-0489da1c921b
|
2401
|
+
active: true
|
2402
|
+
schema:
|
2403
|
+
"$ref": "#/components/schemas/resource"
|
2404
|
+
'422':
|
2405
|
+
description: Invalid request
|
2406
|
+
content:
|
2407
|
+
application/vnd.api+json:
|
2408
|
+
examples:
|
2409
|
+
Example:
|
2410
|
+
value:
|
2411
|
+
error: Name is blank
|
2412
|
+
errors:
|
2413
|
+
name:
|
2414
|
+
- is blank
|
2415
|
+
schema:
|
2416
|
+
"$ref": "#/components/schemas/validation_errors"
|
2417
|
+
'404':
|
2418
|
+
description: Record not found
|
2419
|
+
content:
|
2420
|
+
application/vnd.api+json:
|
2421
|
+
examples:
|
2422
|
+
Example:
|
2423
|
+
value:
|
2424
|
+
error: The resource you were looking for could not be found.
|
2425
|
+
schema:
|
2426
|
+
"$ref": "#/components/schemas/error"
|
2427
|
+
'401':
|
2428
|
+
description: Authentication Failed
|
2429
|
+
content:
|
2430
|
+
application/vnd.api+json:
|
2431
|
+
examples:
|
2432
|
+
Example:
|
2433
|
+
value:
|
2434
|
+
error: The access token is invalid
|
2435
|
+
schema:
|
2436
|
+
"$ref": "#/components/schemas/error"
|
2437
|
+
requestBody:
|
2438
|
+
content:
|
2439
|
+
application/json:
|
2440
|
+
schema:
|
2441
|
+
"$ref": "#/components/schemas/update_data_feed_params"
|
2442
|
+
delete:
|
2443
|
+
summary: Delete a Data Feed
|
2444
|
+
tags:
|
2445
|
+
- Data Feeds
|
2446
|
+
security:
|
2447
|
+
- bearer_auth: [ ]
|
2448
|
+
description: Deletes a Data Feed
|
2449
|
+
operationId: delete-data-feed
|
2450
|
+
parameters:
|
2451
|
+
- name: id
|
2452
|
+
in: path
|
2453
|
+
required: true
|
2454
|
+
schema:
|
2455
|
+
type: string
|
2456
|
+
responses:
|
2457
|
+
'204':
|
2458
|
+
description: Record deleted
|
2459
|
+
'404':
|
2460
|
+
description: Record not found
|
2461
|
+
content:
|
2462
|
+
application/vnd.api+json:
|
2463
|
+
examples:
|
2464
|
+
Example:
|
2465
|
+
value:
|
2466
|
+
error: The resource you were looking for could not be found.
|
2467
|
+
schema:
|
2468
|
+
"$ref": "#/components/schemas/error"
|
2469
|
+
'401':
|
2470
|
+
description: Authentication Failed
|
2471
|
+
content:
|
2472
|
+
application/vnd.api+json:
|
2473
|
+
examples:
|
2474
|
+
Example:
|
2475
|
+
value:
|
2476
|
+
error: The access token is invalid
|
2477
|
+
schema:
|
2478
|
+
"$ref": "#/components/schemas/error"
|
2203
2479
|
"/api/v2/platform/digital_links":
|
2204
2480
|
get:
|
2205
2481
|
summary: Return a list of Digital Links
|
@@ -15490,6 +15766,7 @@ paths:
|
|
15490
15766
|
email: ivonne.braun@smith.biz
|
15491
15767
|
first_name: Liberty
|
15492
15768
|
last_name: Becker
|
15769
|
+
selected_locale: nil
|
15493
15770
|
created_at: '2022-11-08T19:35:53.726Z'
|
15494
15771
|
updated_at: '2022-11-08T19:35:53.726Z'
|
15495
15772
|
public_metadata: {}
|
@@ -15508,6 +15785,7 @@ paths:
|
|
15508
15785
|
email: lenita.mayer@kulas.us
|
15509
15786
|
first_name: Chasidy
|
15510
15787
|
last_name: Strosin
|
15788
|
+
selected_locale: 'fr'
|
15511
15789
|
created_at: '2022-11-08T19:35:53.730Z'
|
15512
15790
|
updated_at: '2022-11-08T19:35:53.730Z'
|
15513
15791
|
public_metadata: {}
|
@@ -15526,6 +15804,7 @@ paths:
|
|
15526
15804
|
email: dewayne@terrybarton.info
|
15527
15805
|
first_name: Ruben
|
15528
15806
|
last_name: Schmidt
|
15807
|
+
selected_locale: 'de'
|
15529
15808
|
created_at: '2022-11-08T19:35:53.732Z'
|
15530
15809
|
updated_at: '2022-11-08T19:35:53.732Z'
|
15531
15810
|
public_metadata: {}
|
@@ -15591,6 +15870,7 @@ paths:
|
|
15591
15870
|
email: rex_champlin@breitenberg.com
|
15592
15871
|
first_name: Zenia
|
15593
15872
|
last_name: King
|
15873
|
+
selected_locale: 'pl'
|
15594
15874
|
created_at: '2022-11-08T19:35:54.351Z'
|
15595
15875
|
updated_at: '2022-11-08T19:35:54.351Z'
|
15596
15876
|
public_metadata: {}
|
@@ -15660,6 +15940,7 @@ paths:
|
|
15660
15940
|
email: gaynell@parisian.biz
|
15661
15941
|
first_name: Irwin
|
15662
15942
|
last_name: DuBuque
|
15943
|
+
selected_locale: 'en'
|
15663
15944
|
created_at: '2022-11-08T19:35:54.635Z'
|
15664
15945
|
updated_at: '2022-11-08T19:35:54.635Z'
|
15665
15946
|
public_metadata: {}
|
@@ -15730,6 +16011,7 @@ paths:
|
|
15730
16011
|
email: john@example.com
|
15731
16012
|
first_name: Astrid
|
15732
16013
|
last_name: Kohler
|
16014
|
+
selected_locale: 'fr'
|
15733
16015
|
created_at: '2022-11-08T19:35:55.180Z'
|
15734
16016
|
updated_at: '2022-11-08T19:35:55.414Z'
|
15735
16017
|
public_metadata: {}
|
@@ -17669,7 +17951,7 @@ servers:
|
|
17669
17951
|
- url: http://{defaultHost}
|
17670
17952
|
variables:
|
17671
17953
|
defaultHost:
|
17672
|
-
default: localhost:
|
17954
|
+
default: localhost:4000
|
17673
17955
|
tags:
|
17674
17956
|
- name: Addresses
|
17675
17957
|
- name: Adjustments
|
@@ -19179,6 +19461,48 @@ components:
|
|
19179
19461
|
- cms_section
|
19180
19462
|
title: Update a Rich Text Section
|
19181
19463
|
x-internal: false
|
19464
|
+
create_data_feed_params:
|
19465
|
+
type: object
|
19466
|
+
properties:
|
19467
|
+
data_feed:
|
19468
|
+
type: object
|
19469
|
+
required:
|
19470
|
+
- name
|
19471
|
+
- type
|
19472
|
+
properties:
|
19473
|
+
name:
|
19474
|
+
type: string
|
19475
|
+
example: 'First data feed'
|
19476
|
+
slug:
|
19477
|
+
type: string
|
19478
|
+
example: 'first-data-feed'
|
19479
|
+
type:
|
19480
|
+
type: string
|
19481
|
+
example: 'Spree::DataFeed::Google'
|
19482
|
+
active:
|
19483
|
+
type: boolean
|
19484
|
+
x-internal: false
|
19485
|
+
update_data_feed_params:
|
19486
|
+
type: object
|
19487
|
+
properties:
|
19488
|
+
data_feed:
|
19489
|
+
type: object
|
19490
|
+
required:
|
19491
|
+
- name
|
19492
|
+
- type
|
19493
|
+
properties:
|
19494
|
+
name:
|
19495
|
+
type: string
|
19496
|
+
example: 'First data feed'
|
19497
|
+
slug:
|
19498
|
+
type: string
|
19499
|
+
example: 'first-data-feed'
|
19500
|
+
type:
|
19501
|
+
type: string
|
19502
|
+
example: 'Spree::DataFeed::Google'
|
19503
|
+
active:
|
19504
|
+
type: boolean
|
19505
|
+
x-internal: false
|
19182
19506
|
create_digital_params:
|
19183
19507
|
type: object
|
19184
19508
|
properties:
|
@@ -21338,6 +21662,8 @@ components:
|
|
21338
21662
|
type: string
|
21339
21663
|
password_confirmation:
|
21340
21664
|
type: string
|
21665
|
+
selected_locale:
|
21666
|
+
type: string
|
21341
21667
|
ship_address_id:
|
21342
21668
|
type: string
|
21343
21669
|
bill_address_id:
|
@@ -21365,6 +21691,8 @@ components:
|
|
21365
21691
|
type: string
|
21366
21692
|
password_confirmation:
|
21367
21693
|
type: string
|
21694
|
+
selected_locale:
|
21695
|
+
type: string
|
21368
21696
|
ship_address_id:
|
21369
21697
|
type: string
|
21370
21698
|
bill_address_id:
|