datocms-plugin-sdk 2.0.11 → 2.0.13

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.
Files changed (41) hide show
  1. package/dist/cjs/connect.js.map +1 -1
  2. package/dist/cjs/hooks/executeSchemaItemTypeDropdownAction.js +3 -0
  3. package/dist/cjs/hooks/executeSchemaItemTypeDropdownAction.js.map +1 -0
  4. package/dist/cjs/hooks/renderPage.js.map +1 -1
  5. package/dist/cjs/hooks/schemaItemTypeDropdownActions.js +3 -0
  6. package/dist/cjs/hooks/schemaItemTypeDropdownActions.js.map +1 -0
  7. package/dist/cjs/index.js +2 -0
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/manifest.js +110 -28
  10. package/dist/cjs/manifest.js.map +1 -1
  11. package/dist/esm/connect.d.ts +3 -1
  12. package/dist/esm/connect.js.map +1 -1
  13. package/dist/esm/ctx/base.d.ts +2 -0
  14. package/dist/esm/hooks/executeSchemaItemTypeDropdownAction.d.ts +20 -0
  15. package/dist/esm/hooks/executeSchemaItemTypeDropdownAction.js +2 -0
  16. package/dist/esm/hooks/executeSchemaItemTypeDropdownAction.js.map +1 -0
  17. package/dist/esm/hooks/renderPage.d.ts +6 -0
  18. package/dist/esm/hooks/renderPage.js.map +1 -1
  19. package/dist/esm/hooks/schemaItemTypeDropdownActions.d.ts +17 -0
  20. package/dist/esm/hooks/schemaItemTypeDropdownActions.js +2 -0
  21. package/dist/esm/hooks/schemaItemTypeDropdownActions.js.map +1 -0
  22. package/dist/esm/index.d.ts +2 -0
  23. package/dist/esm/index.js +2 -0
  24. package/dist/esm/index.js.map +1 -1
  25. package/dist/esm/manifest.js +110 -28
  26. package/dist/esm/manifest.js.map +1 -1
  27. package/dist/types/connect.d.ts +3 -1
  28. package/dist/types/ctx/base.d.ts +2 -0
  29. package/dist/types/hooks/executeSchemaItemTypeDropdownAction.d.ts +20 -0
  30. package/dist/types/hooks/renderPage.d.ts +6 -0
  31. package/dist/types/hooks/schemaItemTypeDropdownActions.d.ts +17 -0
  32. package/dist/types/index.d.ts +2 -0
  33. package/manifest.json +110 -28
  34. package/package.json +2 -2
  35. package/src/connect.ts +4 -0
  36. package/src/ctx/base.ts +3 -0
  37. package/src/hooks/executeSchemaItemTypeDropdownAction.ts +24 -0
  38. package/src/hooks/renderPage.ts +7 -0
  39. package/src/hooks/schemaItemTypeDropdownActions.ts +22 -0
  40. package/src/index.ts +2 -0
  41. package/src/manifest.ts +113 -28
package/src/manifest.ts CHANGED
@@ -101,6 +101,30 @@ export const manifest: Manifest = {
101
101
  lineNumber: 19,
102
102
  },
103
103
  },
104
+ schemaItemTypeDropdownActions: {
105
+ name: 'schemaItemTypeDropdownActions',
106
+ comment: {
107
+ markdownText:
108
+ 'Use this function to define custom actions (or groups of actions) for a model/block model in the Schema section.\n\nThe `executeSchemaItemTypeDropdownAction()` hook will be triggered once the user\nclicks on one of the defined actions.',
109
+ tag: 'dropdownActions',
110
+ },
111
+ nonCtxArguments: [
112
+ {
113
+ name: 'itemType',
114
+ typeName: 'ItemType',
115
+ },
116
+ ],
117
+ ctxArgument: {
118
+ type: 'Ctx',
119
+ additionalProperties: [],
120
+ additionalMethods: [],
121
+ },
122
+ returnType: 'Array<DropdownAction | DropdownActionGroup>',
123
+ location: {
124
+ filePath: 'src/hooks/schemaItemTypeDropdownActions.ts',
125
+ lineNumber: 16,
126
+ },
127
+ },
104
128
  renderUploadSidebarPanel: {
105
129
  name: 'renderUploadSidebarPanel',
106
130
  comment: {
@@ -251,6 +275,16 @@ export const manifest: Manifest = {
251
275
  },
252
276
  type: 'string',
253
277
  },
278
+ location: {
279
+ comment: {
280
+ markdownText: 'Current page location.',
281
+ },
282
+ location: {
283
+ filePath: 'src/hooks/renderPage.ts',
284
+ lineNumber: 22,
285
+ },
286
+ type: '{\n pathname: string;\n search: string;\n hash: string;\n }',
287
+ },
254
288
  },
255
289
  },
256
290
  ],
@@ -2294,6 +2328,46 @@ export const manifest: Manifest = {
2294
2328
  lineNumber: 13,
2295
2329
  },
2296
2330
  },
2331
+ executeSchemaItemTypeDropdownAction: {
2332
+ name: 'executeSchemaItemTypeDropdownAction',
2333
+ comment: {
2334
+ markdownText:
2335
+ 'Use this function to execute a particular dropdown action defined via\nthe `schemaItemTypeDropdownActions()` hook.',
2336
+ tag: 'dropdownActions',
2337
+ },
2338
+ nonCtxArguments: [
2339
+ {
2340
+ name: 'actionId',
2341
+ typeName: 'string',
2342
+ },
2343
+ {
2344
+ name: 'itemType',
2345
+ typeName: 'ItemType',
2346
+ },
2347
+ ],
2348
+ ctxArgument: {
2349
+ type: 'Ctx',
2350
+ additionalProperties: [
2351
+ {
2352
+ items: {
2353
+ parameters: {
2354
+ location: {
2355
+ filePath: 'src/hooks/executeSchemaItemTypeDropdownAction.ts',
2356
+ lineNumber: 23,
2357
+ },
2358
+ type: 'Record<string, unknown> | undefined',
2359
+ },
2360
+ },
2361
+ },
2362
+ ],
2363
+ additionalMethods: [],
2364
+ },
2365
+ returnType: 'Promise<void>',
2366
+ location: {
2367
+ filePath: 'src/hooks/executeSchemaItemTypeDropdownAction.ts',
2368
+ lineNumber: 13,
2369
+ },
2370
+ },
2297
2371
  executeItemsDropdownAction: {
2298
2372
  name: 'executeItemsDropdownAction',
2299
2373
  comment: {
@@ -3072,6 +3146,17 @@ export const manifest: Manifest = {
3072
3146
  },
3073
3147
  type: 'string',
3074
3148
  },
3149
+ isEnvironmentPrimary: {
3150
+ comment: {
3151
+ markdownText:
3152
+ 'Whether the current environment is the primary one.',
3153
+ },
3154
+ location: {
3155
+ filePath: 'src/ctx/base.ts',
3156
+ lineNumber: 64,
3157
+ },
3158
+ type: 'boolean',
3159
+ },
3075
3160
  owner: {
3076
3161
  comment: {
3077
3162
  markdownText:
@@ -3079,7 +3164,7 @@ export const manifest: Manifest = {
3079
3164
  },
3080
3165
  location: {
3081
3166
  filePath: 'src/ctx/base.ts',
3082
- lineNumber: 64,
3167
+ lineNumber: 67,
3083
3168
  },
3084
3169
  type: 'Account | Organization',
3085
3170
  },
@@ -3091,7 +3176,7 @@ export const manifest: Manifest = {
3091
3176
  },
3092
3177
  location: {
3093
3178
  filePath: 'src/ctx/base.ts',
3094
- lineNumber: 72,
3179
+ lineNumber: 75,
3095
3180
  },
3096
3181
  type: 'Account | undefined',
3097
3182
  },
@@ -3102,7 +3187,7 @@ export const manifest: Manifest = {
3102
3187
  },
3103
3188
  location: {
3104
3189
  filePath: 'src/ctx/base.ts',
3105
- lineNumber: 78,
3190
+ lineNumber: 81,
3106
3191
  },
3107
3192
  type: '{\n /** Preferred locale */\n locale: string;\n }',
3108
3193
  },
@@ -3113,7 +3198,7 @@ export const manifest: Manifest = {
3113
3198
  },
3114
3199
  location: {
3115
3200
  filePath: 'src/ctx/base.ts',
3116
- lineNumber: 84,
3201
+ lineNumber: 87,
3117
3202
  },
3118
3203
  type: 'Theme',
3119
3204
  },
@@ -3133,7 +3218,7 @@ export const manifest: Manifest = {
3133
3218
  },
3134
3219
  location: {
3135
3220
  filePath: 'src/ctx/base.ts',
3136
- lineNumber: 94,
3221
+ lineNumber: 97,
3137
3222
  },
3138
3223
  type: 'Partial<Record<string, ItemType>>',
3139
3224
  },
@@ -3144,7 +3229,7 @@ export const manifest: Manifest = {
3144
3229
  },
3145
3230
  location: {
3146
3231
  filePath: 'src/ctx/base.ts',
3147
- lineNumber: 101,
3232
+ lineNumber: 104,
3148
3233
  },
3149
3234
  type: 'Partial<Record<string, Field>>',
3150
3235
  },
@@ -3155,7 +3240,7 @@ export const manifest: Manifest = {
3155
3240
  },
3156
3241
  location: {
3157
3242
  filePath: 'src/ctx/base.ts',
3158
- lineNumber: 108,
3243
+ lineNumber: 111,
3159
3244
  },
3160
3245
  type: 'Partial<Record<string, Fieldset>>',
3161
3246
  },
@@ -3166,7 +3251,7 @@ export const manifest: Manifest = {
3166
3251
  },
3167
3252
  location: {
3168
3253
  filePath: 'src/ctx/base.ts',
3169
- lineNumber: 115,
3254
+ lineNumber: 118,
3170
3255
  },
3171
3256
  type: 'Partial<Record<string, User>>',
3172
3257
  },
@@ -3177,7 +3262,7 @@ export const manifest: Manifest = {
3177
3262
  },
3178
3263
  location: {
3179
3264
  filePath: 'src/ctx/base.ts',
3180
- lineNumber: 122,
3265
+ lineNumber: 125,
3181
3266
  },
3182
3267
  type: 'Partial<Record<string, SsoUser>>',
3183
3268
  },
@@ -3201,7 +3286,7 @@ export const manifest: Manifest = {
3201
3286
  },
3202
3287
  location: {
3203
3288
  filePath: 'src/ctx/base.ts',
3204
- lineNumber: 165,
3289
+ lineNumber: 168,
3205
3290
  },
3206
3291
  type: '(itemTypeId: string) => Promise<Field[]>',
3207
3292
  },
@@ -3214,7 +3299,7 @@ export const manifest: Manifest = {
3214
3299
  },
3215
3300
  location: {
3216
3301
  filePath: 'src/ctx/base.ts',
3217
- lineNumber: 184,
3302
+ lineNumber: 187,
3218
3303
  },
3219
3304
  type: '(itemTypeId: string) => Promise<Fieldset[]>',
3220
3305
  },
@@ -3227,7 +3312,7 @@ export const manifest: Manifest = {
3227
3312
  },
3228
3313
  location: {
3229
3314
  filePath: 'src/ctx/base.ts',
3230
- lineNumber: 201,
3315
+ lineNumber: 204,
3231
3316
  },
3232
3317
  type: '() => Promise<Field[]>',
3233
3318
  },
@@ -3240,7 +3325,7 @@ export const manifest: Manifest = {
3240
3325
  },
3241
3326
  location: {
3242
3327
  filePath: 'src/ctx/base.ts',
3243
- lineNumber: 214,
3328
+ lineNumber: 217,
3244
3329
  },
3245
3330
  type: '() => Promise<User[]>',
3246
3331
  },
@@ -3253,7 +3338,7 @@ export const manifest: Manifest = {
3253
3338
  },
3254
3339
  location: {
3255
3340
  filePath: 'src/ctx/base.ts',
3256
- lineNumber: 227,
3341
+ lineNumber: 230,
3257
3342
  },
3258
3343
  type: '() => Promise<SsoUser[]>',
3259
3344
  },
@@ -3275,7 +3360,7 @@ export const manifest: Manifest = {
3275
3360
  },
3276
3361
  location: {
3277
3362
  filePath: 'src/ctx/base.ts',
3278
- lineNumber: 249,
3363
+ lineNumber: 252,
3279
3364
  },
3280
3365
  type: '(params: Record<string, unknown>) => Promise<void>',
3281
3366
  },
@@ -3288,7 +3373,7 @@ export const manifest: Manifest = {
3288
3373
  },
3289
3374
  location: {
3290
3375
  filePath: 'src/ctx/base.ts',
3291
- lineNumber: 300,
3376
+ lineNumber: 303,
3292
3377
  },
3293
3378
  type: '(\n fieldId: string,\n changes: FieldAppearanceChange[],\n ) => Promise<void>',
3294
3379
  },
@@ -3310,7 +3395,7 @@ export const manifest: Manifest = {
3310
3395
  },
3311
3396
  location: {
3312
3397
  filePath: 'src/ctx/base.ts',
3313
- lineNumber: 405,
3398
+ lineNumber: 408,
3314
3399
  },
3315
3400
  type: '(message: string) => Promise<void>',
3316
3401
  },
@@ -3323,7 +3408,7 @@ export const manifest: Manifest = {
3323
3408
  },
3324
3409
  location: {
3325
3410
  filePath: 'src/ctx/base.ts',
3326
- lineNumber: 420,
3411
+ lineNumber: 423,
3327
3412
  },
3328
3413
  type: '(message: string) => Promise<void>',
3329
3414
  },
@@ -3336,7 +3421,7 @@ export const manifest: Manifest = {
3336
3421
  },
3337
3422
  location: {
3338
3423
  filePath: 'src/ctx/base.ts',
3339
- lineNumber: 444,
3424
+ lineNumber: 447,
3340
3425
  },
3341
3426
  type: '<CtaValue = unknown>(\n toast: Toast<CtaValue>,\n ) => Promise<CtaValue | null>',
3342
3427
  },
@@ -3358,7 +3443,7 @@ export const manifest: Manifest = {
3358
3443
  },
3359
3444
  location: {
3360
3445
  filePath: 'src/ctx/base.ts',
3361
- lineNumber: 330,
3446
+ lineNumber: 333,
3362
3447
  },
3363
3448
  type: '(itemTypeId: string) => Promise<Item | null>',
3364
3449
  },
@@ -3371,7 +3456,7 @@ export const manifest: Manifest = {
3371
3456
  },
3372
3457
  location: {
3373
3458
  filePath: 'src/ctx/base.ts',
3374
- lineNumber: 351,
3459
+ lineNumber: 354,
3375
3460
  },
3376
3461
  type: '{\n (\n itemTypeId: string,\n options: { multiple: true; initialLocationQuery?: ItemListLocationQuery },\n ): Promise<Item[] | null>;\n (\n itemTypeId: string,\n options?: {\n multiple: false;\n initialLocationQuery?: ItemListLocationQuery;\n },\n ): Promise<Item | null>;\n }',
3377
3462
  },
@@ -3384,7 +3469,7 @@ export const manifest: Manifest = {
3384
3469
  },
3385
3470
  location: {
3386
3471
  filePath: 'src/ctx/base.ts',
3387
- lineNumber: 383,
3472
+ lineNumber: 386,
3388
3473
  },
3389
3474
  type: '(itemId: string) => Promise<Item | null>',
3390
3475
  },
@@ -3406,7 +3491,7 @@ export const manifest: Manifest = {
3406
3491
  },
3407
3492
  location: {
3408
3493
  filePath: 'src/ctx/base.ts',
3409
- lineNumber: 471,
3494
+ lineNumber: 474,
3410
3495
  },
3411
3496
  type: '{\n (options: { multiple: true }): Promise<Upload[] | null>;\n (options?: { multiple: false }): Promise<Upload | null>;\n }',
3412
3497
  },
@@ -3419,7 +3504,7 @@ export const manifest: Manifest = {
3419
3504
  },
3420
3505
  location: {
3421
3506
  filePath: 'src/ctx/base.ts',
3422
- lineNumber: 499,
3507
+ lineNumber: 502,
3423
3508
  },
3424
3509
  type: '(\n uploadId: string,\n ) => Promise<(Upload & { deleted?: true }) | null>',
3425
3510
  },
@@ -3432,7 +3517,7 @@ export const manifest: Manifest = {
3432
3517
  },
3433
3518
  location: {
3434
3519
  filePath: 'src/ctx/base.ts',
3435
- lineNumber: 527,
3520
+ lineNumber: 530,
3436
3521
  },
3437
3522
  type: '(\n /** The "single asset" field structure */\n fileFieldValue: FileFieldValue,\n /** Shows metadata information for a specific locale */\n locale?: string,\n ) => Promise<FileFieldValue | null>',
3438
3523
  },
@@ -3454,7 +3539,7 @@ export const manifest: Manifest = {
3454
3539
  },
3455
3540
  location: {
3456
3541
  filePath: 'src/ctx/base.ts',
3457
- lineNumber: 558,
3542
+ lineNumber: 561,
3458
3543
  },
3459
3544
  type: '(modal: Modal) => Promise<unknown>',
3460
3545
  },
@@ -3467,7 +3552,7 @@ export const manifest: Manifest = {
3467
3552
  },
3468
3553
  location: {
3469
3554
  filePath: 'src/ctx/base.ts',
3470
- lineNumber: 595,
3555
+ lineNumber: 598,
3471
3556
  },
3472
3557
  type: '(options: ConfirmOptions) => Promise<unknown>',
3473
3558
  },
@@ -3488,7 +3573,7 @@ export const manifest: Manifest = {
3488
3573
  },
3489
3574
  location: {
3490
3575
  filePath: 'src/ctx/base.ts',
3491
- lineNumber: 609,
3576
+ lineNumber: 612,
3492
3577
  },
3493
3578
  type: '(path: string) => Promise<void>',
3494
3579
  },